Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix FancyArrow rendering for zero-length arrows#30243

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
QuLogic merged 6 commits intomatplotlib:mainfromnrnavaneet:fix-fancyarrow-empty
Jul 3, 2025

Conversation

nrnavaneet
Copy link
Contributor

Fixes#30242: Cannot create empty FancyArrow (expired NumPy deprecation).

Summary of changes:
•Addresses a bug where FancyArrow(length=0) caused issues due to expired NumPy behavior.
•Adds an explicit check for zero length to safely initialize self.verts as an empty array.
•Adds a test case test_empty_fancyarrow in test_patches.py to confirm correct behavior for zero-length arrows.

This change ensures that FancyArrow gracefully handles length=0 without triggering errors or deprecated behavior in newer NumPy versions.

@nrnavaneet
Copy link
ContributorAuthor

This PR only affects FancyArrow behavior when length == 0 and adds a test for it. The CI failures in docs/AppVeyor are unrelated and seem to be happening globally. Pre-commit passes locally.

@@ -1538,7 +1538,7 @@ def _make_verts(self):
length = distance
else:
length = distance + head_length
if not length:
if(isinstance(length, np.ndarray) and length.size == 0) or (not length):
Copy link
Member

Choose a reason for hiding this comment

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

You can usenp.size here.

@nrnavaneet
Copy link
ContributorAuthor

Thank you for the review,@QuLogic! 🙌
I’ve updated the condition to use np.size(length) as suggested, and also removed the .python-version file from the commit. Everything should be good now. Please let me know if anything else needs changes. 😊

@QuLogicQuLogic added this to thev3.10.4 milestoneJul 3, 2025
@QuLogicQuLogic merged commit70d5ad4 intomatplotlib:mainJul 3, 2025
37 of 40 checks passed
@QuLogic
Copy link
Member

Thanks@nrnavaneet! Congratulations on your first PR to Matplotlib 🎉 We hope to hear from you again.

@lumberbot-appLumberbot (App)
Copy link

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout v3.10.xgit pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 70d5ad48fc26045739d5c57538686f7619cfa8bb
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #30243: Fix FancyArrow rendering for zero-length arrows'
  1. Push to a named branch:
git push YOURFORK v3.10.x:auto-backport-of-pr-30243-on-v3.10.x
  1. Create a PR against branch v3.10.x, I would have named this PR:

"Backport PR#30243 on branch v3.10.x (Fix FancyArrow rendering for zero-length arrows)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove theStill Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free tosuggest an improvement.

QuLogic pushed a commit to QuLogic/matplotlib that referenced this pull requestJul 3, 2025
QuLogic pushed a commit to QuLogic/matplotlib that referenced this pull requestJul 3, 2025
jkseppan added a commit that referenced this pull requestJul 4, 2025
…3.10.xBackport PR#30243 on branch v3.10.x (Fix FancyArrow rendering for zero-length arrows)
@nrnavaneetnrnavaneet deleted the fix-fancyarrow-empty branchJuly 8, 2025 15:27
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
v3.10.4
Development

Successfully merging this pull request may close these issues.

[Bug]: Cannot create empty FancyArrow (expired numpy deprecation)
3 participants
@nrnavaneet@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp