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 QuadContourSet.allsegs, .allkinds, .tcolors, .tlinewidths. #25138

Merged
merged 1 commit into from Mar 10, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Feb 2, 2023

Directly construct the relevant path objects and the collections with the right properties instead of carrying around another copy of the information in raw array form. By having fewer intermediate objects lying around for a long time (as attributes of the QuadContourSet) this makes the logic easier to follow. This also prepares for #25128, but I'd say the change is worthwhile even if we eventually decide not to go that route.

PR Summary

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

@tacaswell
Copy link
Member

I strongly suspect that these are widely used by people who want to extract contour computations from Matplotlib. We may have to settle for converting these to just properties (or a longer than normal deprecation cycle).

@anntzer
Copy link
Contributor Author

anntzer commented Feb 2, 2023

At least tcolors and tlinewidths should be safe to deprecate. I'd say allsegs and allkinds are better provided by contourpy nowadays, but your remark is well taken and we can at least make the deprecation pending (or even keep them around, if you think that's important, I don't feel very strongly about this).

@jklymak
Copy link
Member

jklymak commented Feb 9, 2023

@ianthomas23 did you have time to comment on this?

@ianthomas23
Copy link
Member

Yes, I am 👍 on this. As Tom says the allsegs and allkinds might be being used by quite a few people, but they shouldn't be from now on and can be redirected to contourpy.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

The other deprecations could probably do with a test to ensure they don't break, espectially since the pending ones may be around for a while.

lib/matplotlib/tests/test_contour.py Show resolved Hide resolved
@anntzer
Copy link
Contributor Author

anntzer commented Mar 8, 2023

Sure, done.

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

Just need to ensure these are the right warnings.

lib/matplotlib/tests/test_contour.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_contour.py Outdated Show resolved Hide resolved
Directly construct the relevant path objects and the collections with
the right properties instead of carrying around another copy of the
information in raw array form.  By having fewer intermediate objects
lying around for a long time (as attributes of the QuadContourSet) this
makes the logic easier to follow.
@anntzer
Copy link
Contributor Author

anntzer commented Mar 8, 2023

Sure, done.

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

5 participants