-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Added warnings for easily confusible subplot/subplots invokations #898
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
Conversation
# sharex. | ||
if not isinstance(sharex, bool) : | ||
warnings.warn("sharex argument to subplots() was not boolean." | ||
" Did you intend to use subplot()?") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we make this a DeprecationWarning -- indicating that it may become an exception in the future and the user is encouraged to change their code. (And same for the warning above).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I agree that this is a deprecation warning (which is hidden by default since python 2.7). It is not the case that this functionality used to work and some structural/procedural change it will mean it will removed in future versions; instead it is a warning to a user to tell them that what they have passed as arguments indicates that they are probably doing the wrong thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes -- but in the future we may not want to let them do the wrong thing and turn this into an exception -- therefore I think a DeprecationWarning might be appropriate.
#880 is relevant to this issue too. |
This has my +1. |
I think I have to rework this code anyway so that it will be put in when pyplot.py gets generated automatically |
@WeatherGod: Any update? We may as well put this issue to bed sooner rather than later. |
Hmmm, my rebase attempts seemed to be bringing in lots of other stuff. It would probably be better to simply make a new PR. |
Agreed. This PR should not be merged in its current state as there are changes in the diffs that are not intended to be part of this PR. Strange that it would merge so strangely. |
And I think I fixed the bad rebase. Don't know how that happened, but the commit list now looks reasonable. |
Anybody want to merge this, go ahead. Merging my own PR is bad style. |
Added warnings for easily confusible subplot/subplots invocations
Just remember who did the merge when I need such a favour! ;-) |
such as::
subplots(1, 2, 1) and subplot(1, 2, False).