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

Skip to content

Deprecate mpl#1670

Merged
dmcdougall merged 5 commits intomatplotlib:masterfrom
dmcdougall:deprecate_mpl
Jan 17, 2013
Merged

Deprecate mpl#1670
dmcdougall merged 5 commits intomatplotlib:masterfrom
dmcdougall:deprecate_mpl

Conversation

@dmcdougall
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread CHANGELOG Outdated
Copy link
Copy Markdown
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.

Comment thread lib/matplotlib/pylab.py
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

4 participants