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

Skip to content

new MatplotlibDeprecationWarning class #1565

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

Closed
wants to merge 1 commit into from

Conversation

ivanov
Copy link
Member

@ivanov ivanov commented Dec 5, 2012

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

this was motivated by the discussion over in #1535

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
```
@@ -3135,12 +3135,12 @@ def connect(self, s, func):
disconnect to disconnect from the axes event

"""
raise DeprecationWarning('use the callbacks CallbackRegistry instance '
raise mDeprecation('use the callbacks CallbackRegistry instance '
'instead')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation on all of these is now squiffy. Would you mind de-denting the continued lines throughout?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, de-denting to align the starting single quotes--I hope that is what you mean, @pelson.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Thu, Dec 6, 2012 at 11:39 AM, Eric Firing [email protected]:

Specifically, de-denting to align the starting single quotes--I hope that
is what you mean, @pelson https://github.com/pelson.

+1

Damon McDougall
http://www.damon-is-a-geek.com
Institute for Computational Engineering Sciences
201 E. 24th St.
Stop C0200
The University of Texas at Austin
Austin, TX 78712-1229

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep 😄

@pelson
Copy link
Member

pelson commented Dec 6, 2012

Is this a good time to go through and remove everything that we said we would remove. There are quite a few old deprecations which we can now just remove.

@WeatherGod
Copy link
Member

Let's make that a separate task

@mdboom
Copy link
Member

mdboom commented Dec 6, 2012

Yes -- but if many people have not been seeing this DeprecationWarnings (because they were on Python 2.7 and didn't turn on all warnings) is it right to pull the features before adequate warning? Maybe we put this PR on 1.2.x, we plan on a 1.2.1 for certain, and then we remove things on master?

@WeatherGod
Copy link
Member

I would be amendable to that idea.

@dmcdougall
Copy link
Member

@mdboom That's just as well, since this will lead to merge conflicts due to the recent PEP8 changes on the axes module.

Instead of rebasing, how about we just create a new PR targeting 1.2.x?

@mdboom
Copy link
Member

mdboom commented Dec 7, 2012

A new PR would probably be best -- it's cleaner than the backporting we sometimes do.

@dmcdougall
Copy link
Member

Agreed.

@ivanov Would you be able to do that?

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.

6 participants