Deprecate mpl #1670

Merged
merged 5 commits into from Jan 17, 2013

Conversation

Projects
None yet
4 participants
@dmcdougall
Member

dmcdougall commented Jan 16, 2013

Rebased and updated version of #1535.

ivanov added some commits Nov 26, 2012

deprecate undocumented `matplotlib/mpl.py`
`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

This comment has been minimized.

Show comment Hide comment
@dmcdougall

dmcdougall Jan 16, 2013

Member

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

Member

dmcdougall commented Jan 16, 2013

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

@dmcdougall

View changes

CHANGELOG
@@ -27,6 +30,7 @@
color so that any alpha set by markerfacecolor will respected.
- Thomas Caswell
+>>>>>>> deprecate undocumented `matplotlib/mpl.py`

This comment has been minimized.

Show comment Hide comment
@dmcdougall

dmcdougall Jan 16, 2013

Member

Pants. I forgot about that. One second.

@dmcdougall

dmcdougall Jan 16, 2013

Member

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

This comment has been minimized.

Show comment Hide comment
@efiring

efiring Jan 16, 2013

Owner

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.

@efiring

efiring Jan 16, 2013

Owner

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

This comment has been minimized.

Show comment Hide comment
@NelleV

NelleV Jan 16, 2013

Contributor

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

Contributor

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

This comment has been minimized.

Show comment Hide comment
@dmcdougall

dmcdougall Jan 17, 2013

Member

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

Member

dmcdougall commented Jan 17, 2013

@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

1 check failed

default The Travis build failed
Details

@dmcdougall dmcdougall deleted the dmcdougall:deprecate_mpl branch Jan 17, 2013

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