-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX/ENH: Introduce a monolithic legend handler for Line2D #20699
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
FIX/ENH: Introduce a monolithic legend handler for Line2D #20699
Conversation
f28247a
to
471ae33
Compare
Without digging through the discussion, can you explain this deprecation path? I'd have thought that changing the behaviour of the returned object was worse than explicitly returning a different class. |
471ae33
to
3539f18
Compare
I don't have a very strong opinion here, but do you have another proposal? (Preferably without rehashing the whole discussion at #11358...) |
I thought the alternative would be to return a new class (ideally a subclass of the old one). It would only break people explicitly relying on the different behaviour. To get the old behaviour they would get the old class back. |
Btw I agree that it's not worth a noisy deprecation cycle. |
Do you mean calling the new handler e.g. |
I don't know enough of the details to have a strong preference either |
OK, I'll let other reviewers chime in then. |
So the main difference is returning
Off the top of my head, that should cover all realistic use cases of the present API.
I suppose nobody is using these classes by name. So, which one is the If people need to keep compatibility with older versions, they can do:
which should be document in the API change note. |
Sure, it's a bit wordy because the normal machinery shouldn't trigger the deprecation, but it's done now. |
c0e1c1b
to
f86bfa1
Compare
f86bfa1
to
a25fd75
Compare
PR Summary
This is a rebase of #11358 (fixing #2035, #11357, #18391, #20552) on top of #20670 (to address #11358 (comment)) and with an additional commit on top to address other comments.
I decided to keep both legend handlers public for now (based on comments in the original thread); we can always decide to deprecate the old handler later.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).... except for
markevery=<float>
or(<float>, <float>)
which is aspec relative to the axes size (keeping handling of that specific case
into _mark_every_path).