Skip to content
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

Merged
merged 5 commits into from Jan 17, 2013
Merged

Deprecate mpl #1670

merged 5 commits into from Jan 17, 2013

Conversation

dmcdougall
Copy link
Member

Rebased and updated version of #1535.

`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.
@dmcdougall
Copy link
Member Author

@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`
Copy link
Member Author

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
Copy link
Member

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.

@NelleV
Copy link
Member

NelleV commented Jan 16, 2013

@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.

@dmcdougall
Copy link
Member Author

@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.

dmcdougall added a commit that referenced this pull request Jan 17, 2013
@dmcdougall dmcdougall merged commit 78ce67d into matplotlib:master Jan 17, 2013
@dmcdougall dmcdougall deleted the deprecate_mpl branch January 17, 2013 00:09
sopac added a commit to sopac/ocean-portal-docker that referenced this pull request May 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants