Skip to content

FIX: re-instate verbose alias#10726

Merged
tacaswell merged 1 commit into
matplotlib:masterfrom
jklymak:FIX-re-instate-verbose-alias
Mar 12, 2018
Merged

FIX: re-instate verbose alias#10726
tacaswell merged 1 commit into
matplotlib:masterfrom
jklymak:FIX-re-instate-verbose-alias

Conversation

@jklymak

@jklymak jklymak commented Mar 8, 2018

Copy link
Copy Markdown
Member

PR Summary

The verbose alias was inadvertently dropped so folks can no longer

import matplotlib.verbose

Given that this is public API, it should not have been removed...

closes #10716

PR Checklist

  • Code is PEP 8 compliant

@jklymak jklymak mentioned this pull request Mar 8, 2018
6 tasks
@jklymak jklymak added this to the v2.2.1 milestone Mar 8, 2018
@jklymak jklymak added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Mar 8, 2018
@anntzer

anntzer commented Mar 8, 2018

Copy link
Copy Markdown
Contributor

You almost certainly need to 1) wrap that in something that catches the deprecation warning, and 2) add a deprecation warning to all methods of verbose (as the user will not see the one in the ctor (unless he decides to build his own instance of Verbose)).

@jklymak

jklymak commented Mar 8, 2018

Copy link
Copy Markdown
Member Author

I get the deprecation warning with

from matplotlib import verbose

Not good enough?

@anntzer

anntzer commented Mar 8, 2018

Copy link
Copy Markdown
Contributor

you probably get it with just "import matplotlib" no?...

@jklymak

jklymak commented Mar 8, 2018

Copy link
Copy Markdown
Member Author

Oh goodness I hope not.

If so hints on wrapping appreciated.

@anntzer

anntzer commented Mar 8, 2018

Copy link
Copy Markdown
Contributor

Just wrap all methods manually too.
There's no (practical) way in which you can trigger a warning when people just access the object from the module without interacting with it in any way (well see njsmith's metamodule for example for a solution, not that I suggest to use this here), but that's the same situation as when we're deprecating e.g. functions (the warning only occurs when you call the function) and we just accept that as being good enough.

@dopplershift

Copy link
Copy Markdown
Contributor

I didn't realize it when we had the RC's, but I think this broke PyCharm's support for embedding figures.

Not to make this any worse or anything. 😉

@jklymak

jklymak commented Mar 8, 2018

Copy link
Copy Markdown
Member Author

OK, well, this is a bit out of my depth.

import matplotlib

indeed triggers the deprecation warning if I have in __init__.py:

# define verbose so it can be imported...
verbose = Verbose()

I don't know how to turn that warning off and still assign verbose.

@jklymak jklymak force-pushed the FIX-re-instate-verbose-alias branch from 8c63473 to a10e0ee Compare March 8, 2018 23:58
@jklymak

jklymak commented Mar 8, 2018

Copy link
Copy Markdown
Member Author

OK< think I got it.

import matplotlib 
from matplotlib import verbose

issues no warnings. But

verbose.report('Boo')

does....

@jklymak jklymak force-pushed the FIX-re-instate-verbose-alias branch from a10e0ee to b603978 Compare March 9, 2018 00:01
@efiring

efiring commented Mar 11, 2018

Copy link
Copy Markdown
Member

Looks like this can go in after a rebase.

@jklymak jklymak force-pushed the FIX-re-instate-verbose-alias branch from b603978 to eecdc3c Compare March 11, 2018 17:43
@jklymak

jklymak commented Mar 11, 2018

Copy link
Copy Markdown
Member Author

@dopplershift this is a good example of a mysterious failing codecov/project/tests.

@QuLogic

QuLogic commented Mar 11, 2018

Copy link
Copy Markdown
Member

Because macOS builds didn't upload any coverage...

@jklymak

jklymak commented Mar 11, 2018

Copy link
Copy Markdown
Member Author

Ahhhh. Cool. Thanks!

@tacaswell tacaswell merged commit e99bee8 into matplotlib:master Mar 12, 2018
lumberbot-app Bot pushed a commit that referenced this pull request Mar 12, 2018
QuLogic added a commit that referenced this pull request Mar 12, 2018
@tacaswell

Copy link
Copy Markdown
Member

I think something went wrong with the rebase as this does not actually but verbose back any more....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Removal of verbose not documented: AttributeError: module 'matplotlib' has no attribute 'verbose'

6 participants