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 default return of Collection.get_{cap,join}style#25810

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

Conversation

QuLogic
Copy link
Member

@QuLogicQuLogic commentedMay 4, 2023
edited
Loading

PR summary

If neither are specified at object creation, the default is to beNone. This brokeget_{cap,join}style when the enum wrappers were created as they assume the internal value is always an enum value.

$ python -c 'from matplotlib.collections import Collection; print(Collection().get_capstyle())'Traceback (most recent call last):  File "<string>", line 1, in <module>  File ".../lib/matplotlib/collections.py", line 643, in get_capstyle    return self._capstyle.nameAttributeError: 'NoneType' object has no attribute 'name'$ python -c 'from matplotlib.collections import Collection; print(Collection().get_joinstyle())'Traceback (most recent call last):  File "<string>", line 1, in <module>  File ".../lib/matplotlib/collections.py", line 657, in get_joinstyle    return self._joinstyle.nameAttributeError: 'NoneType' object has no attribute 'name'

This was broken since the initial addition of the enums in#18544, so I'm not sure if it should be backported (minus the typing changes.)

PR checklist

@ksunden
Copy link
Member

ksunden commentedMay 4, 2023
edited
Loading

The alternative would be to resolve to the default. As far as I can tell the default is hard codedhere, so not controlled by rcparam. I suppose backendscould override the default? But not convinced that edge case is worth accounting for.

@QuLogic
Copy link
MemberAuthor

Yes, this was added in#9523 and, ifNone, defaulted to backend renderer state. Also,#17575 documented this as defaulting to thepatch.{cap,join}style rcParam, but that doesn't appear to be true. Alternatively we could start defining a default for collections as documented.

Either way, we should probably fix the default and documented default to match.

@ksundenksunden added this to thev3.8.0 milestoneJul 26, 2023
@ksunden
Copy link
Member

Test failure is almost certainly the MacOS/Azure/Tk problem we were having.

If neither are specified at object creation, the default is to be`None`. This broke `get_{cap,join}style` when the enum wrappers werecreated as they assume the internal value is always an enum value.
@QuLogicQuLogicforce-pushed thefix-default-collection-style branch from2f4f08e to4b99bc6CompareJuly 27, 2023 07:50
@greglucasgreglucas merged commit3ca6f23 intomatplotlib:mainJul 28, 2023
@QuLogicQuLogic deleted the fix-default-collection-style branchJuly 28, 2023 02:20
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@ksundenksundenksunden approved these changes

@greglucasgreglucasgreglucas approved these changes

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

Successfully merging this pull request may close these issues.

3 participants
@QuLogic@ksunden@greglucas

[8]ページ先頭

©2009-2025 Movatter.jp