-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Restore (and warn on) seaborn styles in style.library #24265
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
Conversation
@@ -184,6 +184,8 @@ def test_deprecated_seaborn_styles(): | |||
with pytest.warns(mpl._api.MatplotlibDeprecationWarning): | |||
mpl.style.use("seaborn-bright") | |||
assert mpl.rcParams == seaborn_bright | |||
with pytest.warns(mpl._api.MatplotlibDeprecationWarning): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this? You just tested this three lines above - do we understand why that test passed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's style.use
, this is style.library
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah...
OTOH, do we expect users to access style.library
? Should this be private, or is it useful to expose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we expect them to or not, but we already have the bug report from a user, so it is being used. It is also documented, at least a little, in the module docstring. In any case, this is only the bug fix for now.
available = [] | ||
|
||
|
||
def reload_library(): | ||
"""Reload the style library.""" | ||
global library | ||
library = update_user_library(_base_library) | ||
library.update(update_user_library(_base_library)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To match previous semantics, library should be cleared first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
6d176ed
to
0c1f7e5
Compare
…265-on-v3.6.x Backport PR #24265 on branch v3.6.x (Restore (and warn on) seaborn styles in style.library)
PR Summary
Fixes #24264
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).