Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Avoid floating point rounding causing bezier.get_parallels to fail #16682

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
Mar 5, 2020

Conversation

ksunden
Copy link
Member

@ksunden ksunden commented Mar 5, 2020

PR Summary

Avoids failing due to a very particular floating point cutoff
mismatch when determining if two lines are parallel via two different
methods.

This is the diff provided by @anntzer here

Closes #12820

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

I am unclear what, if any, tests are expected for this diff, as
discussed in #12820. Causing this to happen on an actual figure requires
a rather unlucky set of very specific layout and annotation placement
that is difficult to replicate. A simple test of get_parallels is
possible, but probably not particularly helpful.

My understanding is that since this is only changing floating point
cutoff behaviour, this is not considered an API change, therefore I did
not write a release note. If I am mistaken, please let me know.

@tacaswell tacaswell added this to the v3.2.1 milestone Mar 5, 2020
@tacaswell
Copy link
Member

Test failure looks like it is conda failing.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

👍

We already have tests that hit this code path (but not the exact values that failed). I don't think it is worth adding a fine-tuned test.

@tacaswell
Copy link
Member

Thanks again for your work on tracking this down @ksunden ! There are a lot of unsung heroes in open source, but people who track down error conditions that depend on 13 significant digits have a special place in my ❤️ .

@anntzer anntzer merged commit 7bae46c into matplotlib:master Mar 5, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 5, 2020
@ksunden ksunden deleted the bezier_parallel branch March 5, 2020 23:21
tacaswell added a commit that referenced this pull request Mar 6, 2020
…682-on-v3.2.x

Backport PR #16682 on branch v3.2.x (Avoid floating point rounding causing bezier.get_parallels to fail)
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.

[Annotations] ValueError: lines do not intersect when computing tight bounding box containing arrow with filled paths
3 participants