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

Updatefind_nearest_contour and revert contour deprecations#27088

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
ksunden merged 2 commits intomatplotlib:mainfromrcomer:nearest-contour
Oct 26, 2023

Conversation

rcomer
Copy link
Member

@rcomerrcomer commentedOct 14, 2023
edited
Loading

PR summary

  • Following[Bug]: find_nearest_contour deprecated with no replacement? #27070 (comment), this PR updates theContourSet.find_nearest_contour method so it no longer uses the deprecatedcollections attribute.

    Note that the docstring previously stated in error that the first element of the returned tuple is aCollection. It was actually an integer that indexed thecollections attribute. Since <3.8 behaviour had one collection per level, and in 3.8 we have one path per level I have updated this to say the index of the path.

  • contour.allsegs,contour.allkinds, andcontour.find_nearest_contour are no longer marked for deprecation.

Closes#27070 andcloses#26913

PR checklist

matteobachetti reacted with rocket emoji
segment : int
The indexof the `.Path` in *contour* that is closest to
The indexwithin that closest path of the segment that is closest to
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I'm using "segment" here to mean one of the pieces you get when you split the path by its MOVETOs. I'm not sure I have the language right though. What exactly defines a segment?

Copy link
Contributor

Choose a reason for hiding this comment

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

connected component, I think

Copy link
Member

Choose a reason for hiding this comment

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

The word 'segment' is a bit confusing, because Paths have a methoditer_segments, which splits by code, i.e., a MOVETO returns one point, a CURVE3 returns two points, etc. This does not appear to be the same as the 'segment' used here.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

So should I change “segment” to “connected component” here? Or something else?

Copy link
Member

Choose a reason for hiding this comment

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

I guess it could be a 'subpath'?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

"subpath" is what I have called the variable when I've looped through these, so that is intuitive to me 👍

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

OK I have changed it to "subpath" and also added some explanation of what paths and subpaths correspond to in the plot.

@rcomer
Copy link
MemberAuthor

Updated based on#27070 (comment). There is a possibility for all the return values to beNone, but I think this can only happen if the paths are all empty, which seems artificial. There is also no test for that case.

@anntzer
Copy link
Contributor

I have a slight preference for using the _cm_set approach for handling the pixel=False (if that indeed works, untested) so that the backcompat code doesn't start interfering with the "main intended usage" code.

@rcomer
Copy link
MemberAuthor

It does work. It just seemed odd to me to essentially hack the method's behaviour from outside when directly changing the behaviour was very simple. I will defer to you on that though.

@tacaswelltacaswell added this to thev3.8.1 milestoneOct 18, 2023
@rcomerrcomer changed the titleUpdatefind_nearest_contour to not usecollections attributeUpdatefind_nearest_contour and revert contour deprecationsOct 19, 2023
rcomerand others added2 commitsOctober 26, 2023 19:10
Co-authored-by: Antony Lee <anntzer.lee@gmail.com>
Co-authored-by: Ruth Comer <10599679+rcomer@users.noreply.github.com>
@ksundenksunden merged commit3ecb148 intomatplotlib:mainOct 26, 2023
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestOct 26, 2023
QuLogic added a commit that referenced this pull requestOct 27, 2023
…088-on-v3.8.xBackport PR#27088 on branch v3.8.x (Update `find_nearest_contour` and revert contour deprecations)
@rcomerrcomer deleted the nearest-contour branchOctober 28, 2023 17:26
@ksundenksunden mentioned this pull requestNov 2, 2023
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@anntzeranntzeranntzer left review comments

@jklymakjklymakjklymak left review comments

@matteobachettimatteobachettimatteobachetti left review comments

@tacaswelltacaswelltacaswell approved these changes

@ksundenksundenksunden approved these changes

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

Successfully merging this pull request may close these issues.

[Bug]: find_nearest_contour deprecated with no replacement? ShouldContourSet.allsegs and.allkinds be deprecated?
7 participants
@rcomer@anntzer@tacaswell@QuLogic@jklymak@ksunden@matteobachetti

[8]ページ先頭

©2009-2025 Movatter.jp