Skip to content

Simplify use of Path._fast_from_codes_and_verts. #12868

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 1 commit into from
Dec 4, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Nov 22, 2018

PR Summary

All uses of Path._fast_from_codes_and_verts create the internals dict by
copying the attribute from another Path. Instead of having the caller
create that dict, just let him pass a Path from which to copy the
attributes.

Note that this means that the copying will now also use the
simplify_threshold from the previous Path; however I think it is clear
that the previous behavior of not copying it was an oversight
(compounded by the fact that simplify_threshold is rarely, if ever,
overwritten on a per-Path basis).

Builds on top of #12846, which removes one of these attributes (has_nonfinite, now a deprecated property).
Preparatory work towards #12850.

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
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer force-pushed the fast_path branch 4 times, most recently from 16b0798 to 352d933 Compare November 23, 2018 13:10
All uses of Path._fast_from_codes_and_verts create the internals dict by
copying the attribute from another Path.  Instead of having the caller
create that dict, just let him pass a Path from which to copy the
attributes.

Note that this means that the copying will now also use the
simplify_threshold from the previous Path; however I think it is clear
that the previous behavior of not copying it was an oversight
(compounded by the fact that simplify_threshold is rarely, if ever,
overwritten on a per-Path basis).
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

This all looks reasonable to me.

@timhoffm timhoffm merged commit 1e2fea7 into matplotlib:master Dec 4, 2018
@anntzer anntzer deleted the fast_path branch December 4, 2018 21:54
@QuLogic QuLogic added this to the v3.1 milestone Dec 4, 2018
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.

4 participants