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 array-like linewidth for 3d scatter#23434

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
tacaswell merged 4 commits intomatplotlib:mainfromkrassowski:fix-23433
Aug 3, 2022

Conversation

krassowski
Copy link
Contributor

PR Summary

Fixes#23433 by castingself._linewidths3d tonp.array at the latest stage possible and adds a test to ensure it works.

The casting step could alternatively be moved to happen earlier in the code logic inset_linewidth and inset_3d_properties, but I went for the simplest solution possible. Let me know if you want to change that (in that case, isself._linewidth3d = lw a typo? should it be_linewidths3d?)

PR Checklist

Tests and Styling

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

Copy link

@github-actionsgithub-actionsbot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping@matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join uson gitter for real-time discussion.

For details on testing, writing docs, and our review process, please seethe developer guide

We strive to be a welcoming and open project. Please follow ourCode of Conduct.

@QuLogic
Copy link
Member

I think it'd be better to not do this so late, since this is in the draw call. Then the array can be done once instead of every refresh, which could be a bit slow.

@oscargus
Copy link
Member

I think this should be changed as well:

defset_linewidth(self,lw):
super().set_linewidth(lw)
ifnotself._in_draw:
self._linewidth3d=lw

Both changing the name from_linewidth3d to_linewidths3d and converting into an np-array.

@oscargus
Copy link
Member

oscargus commentedJul 20, 2022
edited
Loading

Maybe one can also add acheck_figures_equal test that uses theset_linewidth method for one of the figures and the keyword argument for the other?

(See the test just below the one you added to see how they work.)

@oscargusoscargus added this to thev3.6.0 milestoneJul 20, 2022
@krassowski
Copy link
ContributorAuthor

krassowski commentedJul 22, 2022
edited
Loading

Maybe one can also add acheck_figures_equal test that uses theset_linewidth method for one of the figures and the keyword argument for the other?

(See the test just below the one you added to see how they work.)

To clarify, sinceset_linewidths is already there in the test case that you are pointing to (and sinceself._linewidths was already getting properly set in thesuper() call it worked ok for scalars as tested), would you like me to add another test like that, but testing that array-likes can be set via keyword argument and setter?

Edit: added, can remove if not needed.

@oscargus
Copy link
Member

oscargus commentedJul 22, 2022
edited
Loading

Considering the spelling error, I do not think that it was actually properly tested, so ideally there should be a test that does set_linewidth and relies on that the spelling is correct.

(The spelling error was introduced in#19812 btw.)

@krassowski
Copy link
ContributorAuthor

The test which I added in2bdbdca should cover that. The documentation build seems to be failing, is there anything I should do, or is it intermittent CI issue?

@scottshambaugh
Copy link
Contributor

scottshambaugh commentedJul 25, 2022
edited
Loading

@krassowski looking atthe docs build logs, I think this was just an intermittent CI issue. I don't think there's a way to re-trigger the tests through the github gui, but if you do agit commit --amend followed by agit push -f I believe that should change the timestamp on your last commit and cause the CI tests to rerun.

@krassowski
Copy link
ContributorAuthor

Thanks, all checks have passed now 🎉

scottshambaugh reacted with hooray emoji

@krassowski
Copy link
ContributorAuthor

A gentle ping on this PR :)

@tacaswelltacaswell merged commit16ad86e intomatplotlib:mainAug 3, 2022
@tacaswell
Copy link
Member

Congratulations on your first merged Matplotlib PR@krassowski 🎉 Hopefully we will hear from you again!

Also thank you for the gentle ping!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@github-actionsgithub-actions[bot]github-actions[bot] left review comments

@oscargusoscargusoscargus approved these changes

Assignees
No one assigned
Projects
Milestone
v3.6.0
Development

Successfully merging this pull request may close these issues.

[Bug]: array-like linewidth raises an error for scatter3D
5 participants
@krassowski@QuLogic@oscargus@scottshambaugh@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp