Skip to content

Use standard property alias machinery in contour(). #30433

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 15, 2025

Note that 'color(s)' remains special-cased because the ContourSet constructor needs to do a fair bit of special wrangling for it.

Closes #1963.

PR summary

PR checklist

Comment on lines 675 to 676
raise TypeError(
"ContourSet.__init__() got an unexpected keyword argument 'color'")
Copy link
Member

Choose a reason for hiding this comment

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

Should use _api.kwarg_error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

rasterized=kwargs.pop("rasterized", False),
)
self.set(edgecolor="none")
self.set(**kwargs) # Let user-set values override defaults.
Copy link
Member

Choose a reason for hiding this comment

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

This is on both sides of the if (though without the comment later), so can move both outside?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

Note that 'color(s)' remains special-cased because the ContourSet
constructor needs to do a fair bit of special wrangling for it.
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.

Singular keyword arguments in contour don't raise exceptions
2 participants