new MatplotlibDeprecationWarning class #1565

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
6 participants
@ivanov
Member

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

new MatplotlibDeprecationWarning class
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')

This comment has been minimized.

Show comment Hide comment
@pelson

pelson Dec 6, 2012

Member

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

@pelson

pelson Dec 6, 2012

Member

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

This comment has been minimized.

Show comment Hide comment
@efiring

efiring Dec 6, 2012

Member

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

@efiring

efiring Dec 6, 2012

Member

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

This comment has been minimized.

Show comment Hide comment
@dmcdougall

dmcdougall Dec 6, 2012

Member

On Thu, Dec 6, 2012 at 11:39 AM, Eric Firing notifications@github.comwrote:

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

@dmcdougall

dmcdougall Dec 6, 2012

Member

On Thu, Dec 6, 2012 at 11:39 AM, Eric Firing notifications@github.comwrote:

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

This comment has been minimized.

Show comment Hide comment
@pelson

pelson Dec 7, 2012

Member

Yep 😄

@pelson

pelson Dec 7, 2012

Member

Yep 😄

@pelson

This comment has been minimized.

Show comment Hide comment
@pelson

pelson Dec 6, 2012

Member

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.

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

This comment has been minimized.

Show comment Hide comment
@WeatherGod

WeatherGod Dec 6, 2012

Member

Let's make that a separate task

Member

WeatherGod commented Dec 6, 2012

Let's make that a separate task

@mdboom

This comment has been minimized.

Show comment Hide comment
@mdboom

mdboom Dec 6, 2012

Member

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?

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

This comment has been minimized.

Show comment Hide comment
@WeatherGod

WeatherGod Dec 6, 2012

Member

I would be amendable to that idea.

Member

WeatherGod commented Dec 6, 2012

I would be amendable to that idea.

@dmcdougall

This comment has been minimized.

Show comment Hide comment
@dmcdougall

dmcdougall Dec 7, 2012

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?

Member

dmcdougall commented Dec 7, 2012

@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

This comment has been minimized.

Show comment Hide comment
@mdboom

mdboom Dec 7, 2012

Member

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

Member

mdboom commented Dec 7, 2012

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

@dmcdougall

This comment has been minimized.

Show comment Hide comment
@dmcdougall

dmcdougall Dec 7, 2012

Member

Agreed.

@ivanov Would you be able to do that?

Member

dmcdougall commented Dec 7, 2012

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