-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
new MatplotlibDeprecationWarning class (against 1.2.x) #1596
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
mdboom
merged 2 commits into
matplotlib:v1.2.x
from
ivanov:mpl-deprecation-warnings-1.2.x
Dec 18, 2012
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
new MatplotlibDeprecationWarning class
In light of the fact that Python builtin DeprecationWarnings are ignored by default as of Python 2.7 (see link below), this class was put in to allow for the signaling of deprecation, but via UserWarnings which are not ignored by default. http://docs.python.org/dev/whatsnew/2.7.html#the-future-for-python-2-x Prior to this commit: ``` In [1]: %pylab Welcome to pylab, a matplotlib-based Python environment [backend: agg]. For more information, type 'help(pylab)'. In [2]: mlab.liaupunov([1,2], np.diff) Out[2]: 0.0 ``` After this commit: ``` In [1]: %pylab Welcome to pylab, a matplotlib-based Python environment [backend: agg]. For more information, type 'help(pylab)'. In [2]: mlab.liaupunov([1,2], np.diff) /home/pi/.local/lib/python2.7/site-packages/matplotlib/mlab.py:1212: MatplotlibDeprecationWarning: This does not belong in matplotlib and will be removed mDeprecation) # 2009/06/13 Out[2]: 0.0 ```
- Loading branch information
commit 10351b33e3f4ca9200ce9832e05735e94bb290c1
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 a fan of renaming the variable here -- it makes it less clear what's happening in the lines below.
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.
Perhaps something a little more verbose?
mplDeprecationWarning?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.
Does just
mplDeprecationseem ok? The reason is that it's either being used in code likewarnings.warn("message", mplDeprecationWarning)and we then have the wordwarnwritten three times on one line, but there are other places where this class is being raised as an exception, so it's not just being used to warn, but actually to throw an error.I was using
mDeprecationbecause I thought we have that as a convention for prepending anmfor matplotlib internal imports (axes.py,axis.py,collections.pyandcontour.pyutilize this for matplotlib module imports)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 those cases, the
mstands for module, which was the source of my confusion about this, at least. I thinkmplDeprecationwould be fine and is a reasonable compromise.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.
mplDeprecationis fine by me!