-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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: Deprecate plt.polar() with an existing non-polar Axes #28946
Conversation
7edef3a
to
c2be3e8
Compare
c2be3e8
to
35b59c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 , but I would like to hold this until after we branch 3.10.x and it needs an API change note.
Although I am coming down in favor of doing this, I'm a bit torn. Clearly what it is doing now is not what anyone wants, but it is not "wrong". Introducing a new hard-fail is a breaking change to what I believe is long standing behavior so needs an API change note and I would like to defer it to 3.11 to have a bit more time (and early adopters) to try it.
IMHO the current behavior is actually "wrong". Not wrong in the sense that pyplot works exactly to its rules, but logically wrong: If I write While this is technically a breaking change, I'm not worried about it. Every affected use case I can imagine, is a hidden error that does not do what the user wants, and it's justifiable to surface that immediately through an exception. |
I'll point out that being able to call plt.polar() after an axes object was
already created used to be a feature. It was certainly an odd one, but it
was inherited from matlab, which would automatically convert the axes into
a polar one. So, this is an old feature that apparently went untested and
is now broken.
Am I for going back to the old way? Probably not, but it should probably be
viewed as us officially acknowledging it as a breaking change.
…On Mon, Oct 7, 2024 at 5:12 PM Tim Hoffmann ***@***.***> wrote:
IMHO the current behavior is actually "wrong". Not wrong in the sense that
pyplot works exactly to its rules, but logically wrong: If I write
plt.polar(...) I clearly expect the data to show up in a polar Axes. It's
surprising and nobody helped with that the data may end up in a rectilinear
Axes. Since we cannot fulfill the polar Axes according to pyplot Axes-reuse
rule if another Axes has already been created, the only reasonable action
is to deny the operation and error out.
While this is technically a breaking change, I'm not worried about it.
Every affected use case I can imagine, is a hidden error that does not do
what the user wants, and it's justifiable to surface that immediately
through an exception.
But if you are seriously concerned about the breaking change, we could
also officially deprecate the behavior (then maybe already for 3.10? but
OTOH it's not urgent) and turn it into an error later.
—
Reply to this email directly, view it on GitHub
<#28946 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHF6HPEL3WUJTXMXOVSV3Z2L2KLAVCNFSM6AAAAABPPXDA52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJXHEYDIOJSGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Before, we only issued a warning. But we clearly cannot fulfill the intention of a polar plot and therefore we should error out instead of just warn. Also document that `polar()` should typically be called first to prevent having a non-polar Axes already created.
35b59c7
to
fc85a12
Compare
I've heard the concerns and turned it into a regular deprecation rather than an immediate failure. But then, I'd like to punt back to 3.10 to get the deprecation rolling. |
Changed into a regular deprecation.
👍 to the deprecation note. If someone complains, they can then fix it and we can change this note. |
Before, we only issued a warning. But we clearly cannot fulfill the intention of a polar plot and therefore we should error out instead of just warn.
Also document that
polar()
should typically be called first to prevent having a non-polar Axes already created.Closes #28944.