-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate mpl #1670
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
Deprecate mpl #1670
Conversation
`matplotlib/mpl.py` is a file which used to get imported via ipython's `%pyplot` interface as module named `mpl`, yet it isn't clear at all what it's role is. Given that in our own code, and in the rest of our python neighborhood, we often do `import matplotlib as mpl`, it's quite a bit confusing to have something with the `mpl` name within matplotlib not be the `matplotlib` module itself. This module was only used in `pylab` interface, where it was simply imported in one line via `from matplotlib import mpl` and never used again. With the exception of mpl.finance, all of the modules in mpl.py were readily available simply via "import matplotlib as mpl". pylab's mpl.finance functionality is retained for backwards compatability.
@NelleV Is that warning and deprecation docstring better? I'm not sure where the docstring should go in a top-level module like this. Feedback encouraged. |
@@ -27,6 +30,7 @@ | |||
color so that any alpha set by markerfacecolor will respected. | |||
- Thomas Caswell | |||
|
|||
>>>>>>> deprecate undocumented `matplotlib/mpl.py` |
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.
Pants. I forgot about that. One second.
import matplotlib as mpl | ||
# make mpl.finance module available for backwards compatability, in case folks | ||
# using pylab interface depended on not having to import it | ||
import matplotlib.finance |
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've never understood what is special about finance here; it is one of the modules imported by mpl.py, and it is not even mentioned in pylab.py.
@dmcdougall module's docstring should be placed at the top of the file. It is already the case in many matplotliib module. When it comes to deprecation warnings, I think it is nice to have them both in the documentation (hence, viewable through matplotlib's website) and with a warning, in the code. The former allows someone new to the project to be warned of the deprecation of a certain module or method, whilst the latter helps maintaining code up to date when running the test suite. |
@NelleV Alright, so it sounds like I did the right thing. The tests pass, too. Python 3.1 failure is a dud. I'll go ahead and merge this now. |
Rebased and updated version of #1535.