Skip to content
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

Deprecate hatch patterns with invalid values #17926

Merged
merged 2 commits into from
Jul 17, 2020

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jul 15, 2020

PR Summary

I noticed while going over the hatch doc PRs that we don't really validate this. This magically works because we just check for the count of the various hatch characters. Since it used to 'work', this adds a deprecation period over which people can fix their calls.

Also, use the new hatch style reference in the Collection docstring since that's more in line with what the docstring is asking for.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • [N/A] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

@QuLogic QuLogic added this to the v3.4.0 milestone Jul 15, 2020
lib/matplotlib/hatch.py Outdated Show resolved Hide resolved
lib/matplotlib/hatch.py Outdated Show resolved Hide resolved
@QuLogic QuLogic force-pushed the warn-hatch branch 2 times, most recently from 9e10c6e to 9bbc045 Compare July 15, 2020 05:49
Copy link
Member

@dstansby dstansby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks 👍 overall. backend_bases.GraphicsContextBase also has a set_hatch, does the same validation need applying there?

lib/matplotlib/hatch.py Show resolved Hide resolved
lib/matplotlib/hatch.py Outdated Show resolved Hide resolved
Instead of the hatch demo, which doesn't do what the docstring says it
does.
@QuLogic
Copy link
Member Author

QuLogic commented Jul 16, 2020

I didn't expect a user to be calling backend_bases.GraphicsContextBase.set_hatch directly, so that's why I didn't add anything to it.

@dstansby dstansby merged commit e5454a3 into matplotlib:master Jul 17, 2020
@QuLogic QuLogic deleted the warn-hatch branch July 17, 2020 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants