Skip to content
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

MNT: remove FeatureArtist.draw args and kwargs #2333

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Feb 25, 2024

Rationale

I was going to propose deprecating these so I added some deprecation warnings. However, when I tried to trigger those warnings I found that you just can't pass extra parameters here. The method has Matplotlib's allow_rasterization decorator which has not passed args and kwargs since matplotlib/matplotlib#20331. Since Matplotlib v3.5 is now our minimum supported version, there is no way these can be used any more. So I propose to just remove them. I had hoped this would lead to simpler code but, unless I'm missing a trick, it doesn't make much difference.

Implications

This removes our internal use of the style module so we could consider deprecating that if we wanted.

Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

I think this makes sense, nice job tracking that down.

One thought for simplification is whether we need to track both stylized and un-stylized paths? Could we instead add an empty style dictionary if there is no style applied? Then we wouldn't need to keep track of both paths.

If we aren't using the style module ourselves it seems like it would be worth deprecating that too.

Comment on lines 189 to 190
stylised_paths = OrderedDict() # used with styler
unstyled_paths = [] # used if there is no styler
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need OrderedDict anymore? The versions of Python we support are now insertion order guaranteed.

@rcomer
Copy link
Member Author

rcomer commented Mar 4, 2024

Could we instead add an empty style dictionary if there is no style applied?

Done. I had already been in two minds about whether to do that as it makes the no-styler case itself more complicated but as you say it reduces paths through the code.

@greglucas greglucas merged commit ebae1d0 into SciTools:main Mar 5, 2024
23 checks passed
@QuLogic QuLogic added this to the Next Release milestone Mar 5, 2024
@rcomer rcomer deleted the draw-deprecations branch March 5, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants