Skip to content

Deprecate parameter props of Shadow #16098

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

Merged
merged 1 commit into from
Mar 24, 2020
Merged

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jan 4, 2020

PR Summary

I was about to deprecate **kwargs with the previous PR on unused parameters. But according to the docs, kwargs should be supported.

Note: This has been in there since 2004, so I'm refraining from backporting due to lack of significance.

@timhoffm timhoffm changed the title Fix passing kwargs to Ticks Fix passing kwargs to Shadow Jan 4, 2020
@timhoffm timhoffm added this to the v3.3.0 milestone Jan 4, 2020
@ImportanceOfBeingErnest
Copy link
Member

What would be the usecase for those kwargs? Since they will be overridden afterwards anyways (i.e. Shadow(...., color="red") will not be red), it seems one should rather deprecate passing of kwargs.

@timhoffm
Copy link
Member Author

timhoffm commented Jan 4, 2020

Fair point. Actually, the properties for the shadow can be passed via prop, see e.g. https://matplotlib.org/devdocs/gallery/text_labels_and_annotations/demo_text_path.html; and they are not overridden.

I've now deprecated **kwargs. Could be debatable if we should deprecate prop instead and make **kwargs work, but **kwargs didn't do anything, so they are the easier deprecation.

This would now fit into #16096 (hence the particular deprecation comment). But I'll leave this standalone and merge the conflict in case anybody has different opinions on prop vs. `**kwargs'.

@anntzer
Copy link
Contributor

anntzer commented Jan 4, 2020

I think deprecating props and making kwargs work looks better (it's more consistent with basically all mpl APIs...) but won't insist on it either.

@timhoffm
Copy link
Member Author

timhoffm commented Jan 4, 2020

Actually, there's a suprising number of prop(s) parameters throughout the library. But I agree **kwargs would be the more common one.

@timhoffm timhoffm changed the title Fix passing kwargs to Shadow Deprecate parameter props of Shadow Jan 5, 2020
@timhoffm
Copy link
Member Author

timhoffm commented Jan 5, 2020

Gone for deprecating props. Shadow is the only class that uses it in the constuctor and as attribute.

@timhoffm
Copy link
Member Author

timhoffm commented Jan 5, 2020

@anntzer Do you want to re-review because the content of the PR changed completely after your approval?

Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

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

lgtm

@QuLogic QuLogic merged commit 7b0cfe4 into matplotlib:master Mar 24, 2020
@timhoffm timhoffm deleted the fix-tick branch March 24, 2020 09:37
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Jun 17, 2020
Starting with matplotlib#16098, extra keyword arguments are now processed, but
that means that default colours and alpha are not set. Instead, those
properties should only be overridden if specified.
@QuLogic QuLogic mentioned this pull request Jun 17, 2020
2 tasks
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.

4 participants