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

Skip to content

FIX: re-instate verbose alias #10726

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

Merged
merged 1 commit into from
Mar 12, 2018

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Mar 8, 2018

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
Copy link
Contributor

anntzer commented Mar 8, 2018

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
Copy link
Member Author

jklymak commented Mar 8, 2018

I get the deprecation warning with

from matplotlib import verbose

Not good enough?

@anntzer
Copy link
Contributor

anntzer commented Mar 8, 2018

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

@jklymak
Copy link
Member Author

jklymak commented Mar 8, 2018

Oh goodness I hope not.

If so hints on wrapping appreciated.

@anntzer
Copy link
Contributor

anntzer commented Mar 8, 2018

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
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
Copy link
Member Author

jklymak commented Mar 8, 2018

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
Copy link
Member Author

jklymak commented Mar 8, 2018

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
Copy link
Member

efiring commented Mar 11, 2018

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
Copy link
Member Author

jklymak commented Mar 11, 2018

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

@QuLogic
Copy link
Member

QuLogic commented Mar 11, 2018

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

@jklymak
Copy link
Member Author

jklymak commented Mar 11, 2018

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