Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix #5777. Don't warn when applying default style #5778

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 3 commits into from
Jan 5, 2016

Conversation

mdboom
Copy link
Member

@mdboom mdboom commented Jan 1, 2016

No description provided.

@mdboom mdboom added this to the next major release (2.0) milestone Jan 1, 2016
@jenshnielsen
Copy link
Member

The context manager is badly named it does not actually catch any warnings it just resets the warning filter when leaving the context. I think you have to do:

with warnings.catch_warnings(record=True):
    warnings.simplefilter("ignore", UserWarning)
    _apply_style(rcParamsDefault)

@jenshnielsen
Copy link
Member

If I understand this correctly the with warnings.catch_warnings(record=True) means that the warning is only showed once but it is still showed exactly once

@mdboom
Copy link
Member Author

mdboom commented Jan 4, 2016

If I understand this correctly the with warnings.catch_warnings(record=True) means that the warning is only showed once but it is still showed exactly once

For me, at least, the warnings aren't shown at all, due to the record=True. But on further consideration, a think a new kwarg is better -- it will be more efficient, as there's no need to generate the warning object in the first place, only to catch and suppress it elsewhere. Updating this PR...

@jenshnielsen
Copy link
Member

It's shown once in https://travis-ci.org/matplotlib/matplotlib/jobs/99718127 but that might be do to other reasons.

@mdboom
Copy link
Member Author

mdboom commented Jan 4, 2016

Let's see if the latest commit here fixes that warning in the doc build. If not, there's probably something else to track down.

@jenshnielsen
Copy link
Member

There is still a single /home/travis/build/matplotlib/matplotlib/lib/matplotlib/style/core.py:53: UserWarning: Style includes a parameter, 'backend', that is not related to style. Ignoring so that must presumably be triggered by some other code path.

jenshnielsen added a commit that referenced this pull request Jan 5, 2016
Fix #5777.  Don't warn when applying default style
@jenshnielsen jenshnielsen merged commit fe701e3 into matplotlib:master Jan 5, 2016
jenshnielsen added a commit to jenshnielsen/matplotlib that referenced this pull request Jan 5, 2016
@jenshnielsen jenshnielsen mentioned this pull request Jan 5, 2016
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.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.