Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update xtick.alignment parameter in rcsetup to validate against correct values #16727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2020

Conversation

MuhammadFarooq1234
Copy link
Contributor

PR Summary

The issue is related to 16584. Users were not able to set xtick.alignment parameter from rcsetup.py in their matplotlibrc files due to validation values not being set correctly. Validation values are now set to ['center', 'right', 'left'] and no errors are thrown when xtick.alignment is set to any of these valid values. Value erro is thrown when set otherwise as expected.

I had added test cases for this issue but commented them out because it seems the warnings they had generated were causing failures:

FixedFormatter should only be used together with FixedLocator

Was not sure if these test cases were necessary for this change so I have them commented out for now but will fix them if required.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@QuLogic
Copy link
Member

QuLogic commented Apr 22, 2020

There should be tests for this; please do not add commented out code.

Also, please rebase instead of merging if possible.

@efiring
Copy link
Member

efiring commented May 6, 2020

@QuLogic Please reconsider the question of tests. This is fundamentally a simple one-line fix to a bug in resetup.py which probably goes way back, and was propagated rather than fixed in the cleanup b32a06a. It is just putting in the right set of strings. For something this simple, I think that adding tests is just adding code to be maintained, not making anything safer.

This appears to be fixing such a simple and obvious bug that we should be sure to get it into 3.3, if at all possible.

@QuLogic
Copy link
Member

QuLogic commented May 6, 2020

There already are tests in this PR; they're just commented out. They either need to work, or not be added at all.

@efiring
Copy link
Member

efiring commented May 6, 2020

Exactly, and I'm suggesting that they should not be added at all. All we need is the first commit in the series.

@MuhammadFarooq1234
Copy link
Contributor Author

Apologies for not responding here, was caught up in some other commitments. I will remove the test cases and rebase within the two days.

@QuLogic
Copy link
Member

QuLogic commented May 6, 2020

Perhaps I was unclear; I did not mean that there should be tests, but that there should be or should not be tests, not some code in limbo.

@QuLogic QuLogic merged commit 9e20541 into matplotlib:master May 6, 2020
@QuLogic
Copy link
Member

QuLogic commented May 6, 2020

Thanks @MuhammadFarooq1234!

@efiring
Copy link
Member

efiring commented May 6, 2020

I think this is your first PR for us, correct? Congratulations, and thank you!

@MuhammadFarooq1234
Copy link
Contributor Author

Thank you both @efiring @QuLogic for your help. I look forward to contributing further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants