Restore (and warn on) seaborn styles in style.library#24265
Merged
anntzer merged 1 commit intomatplotlib:mainfrom Oct 25, 2022
Merged
Restore (and warn on) seaborn styles in style.library#24265anntzer merged 1 commit intomatplotlib:mainfrom
anntzer merged 1 commit intomatplotlib:mainfrom
Conversation
jklymak
reviewed
Oct 25, 2022
| with pytest.warns(mpl._api.MatplotlibDeprecationWarning): | ||
| mpl.style.use("seaborn-bright") | ||
| assert mpl.rcParams == seaborn_bright | ||
| with pytest.warns(mpl._api.MatplotlibDeprecationWarning): |
Member
There was a problem hiding this comment.
Can you explain this? You just tested this three lines above - do we understand why that test passed?
Member
Author
There was a problem hiding this comment.
That's style.use, this is style.library.
Member
There was a problem hiding this comment.
Ah...
OTOH, do we expect users to access style.library? Should this be private, or is it useful to expose?
Member
Author
There was a problem hiding this comment.
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.
anntzer
reviewed
Oct 25, 2022
| """Reload the style library.""" | ||
| global library | ||
| library = update_user_library(_base_library) | ||
| library.update(update_user_library(_base_library)) |
Contributor
There was a problem hiding this comment.
To match previous semantics, library should be cleared first?
6d176ed to
0c1f7e5
Compare
oscargus
approved these changes
Oct 25, 2022
jklymak
approved these changes
Oct 25, 2022
Member
anntzer
approved these changes
Oct 25, 2022
meeseeksmachine
pushed a commit
to meeseeksmachine/matplotlib
that referenced
this pull request
Oct 25, 2022
QuLogic
added a commit
that referenced
this pull request
Oct 25, 2022
…265-on-v3.6.x Backport PR #24265 on branch v3.6.x (Restore (and warn on) seaborn styles in style.library)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Fixes #24264
PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand 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).