Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Still naming inconsistency in API on axes limits #11761

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

Closed
timhoffm opened this issue Jul 23, 2018 · 5 comments
Closed

Still naming inconsistency in API on axes limits #11761

timhoffm opened this issue Jul 23, 2018 · 5 comments
Labels
API: consistency Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@timhoffm
Copy link
Member

timhoffm commented Jul 23, 2018

Bug report

#11137 deprecated the kwargs *min/*max of set_*lim (after some disussion there and in #11293).

Axes.axis uses the *min, *max parameter names as well. Currently, this does not support left, right, bottom, top at all.

This is an inconsistency within the current API, and if we're serious with the change Axes.axis() whould have to be changes as well.

@pierre-haessig
Copy link
Contributor

Hi,

[note: this is almost a copy of my initial message in #11293, but, as @jklymak suggested, this issue is the one open at present]

It's only pretty recently that I discovered the deprecation of xmin, xmax arguments since I'm working with stable releases of Matlplotlib and I only "conda update -all" every month or so. I was pretty surprised, because over the years, I've been consistently using these keyword args and I had literally forgotten that the left and right arguments existed anyway!

So I got rather frustrated by the deprecation, and thus I dig in the PRs. What I read didn't convinced me:

  • original PR Convert **kwargs to named arguments for a clearer API #11137 *"Convert *kwargs to named arguments for a clearer API "

    • first, of course, the purpose of the PR was not to change any API.
    • xmin/max got depecrated far in the middle of the discussion, but only with a very low level of motivation: "Would it be worth deprecating ...?". The reason is purely aesthetical (once the genuine issue of the silent overwrite between the synonymous arguments is settled of course.).
    • then there is a debate whether left is clearer than xmin of vice versa: which one should get deprecated after all?
    • finally deprecation is done while said to be "tangential to the purpose".
    • → As an external reader, it seems that this deprecation was close to the outcome of a dice roll!
  • in PR Lim parameter naming #11293, it is stated that the newly prefered notation left/right makes no sense in other contexts like polar plots

  • now in this PR Still naming inconsistency in API on axes limits #11761, @timhoffm uncovers that the xmin terminology is in fact used elsewhere in Matplotlib API.

So my conclusion is that the "consequence analysis" (sorry, I don't have the proper word for this) for this deprecation was a bit short and I'm not sure the aesthetical reason (the duplicate keywords which I agree is odd) is worth breaking piles of existing codes (assuming I'm not the only weird addict user of xmin, xmax, ymin, ymax ;-) ). Am I indeed lonely?

@timhoffm timhoffm added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Jan 28, 2019
@timhoffm
Copy link
Member Author

Tagging as release critical. Are we really still sure that deprecating xmin, xmax etc. is a good idea (I'm not).

@tacaswell
Copy link
Member

Discussed this on the phone call and decided that we should revert the deprecation of the xmin/xmax and ymin/ymax kwargs.

@tacaswell
Copy link
Member

I still think un-deprecating these is the right path, but I would stress that before #11137 these kwargs were undocumented! That definitely contributed to short discussion "these are not documented, so we expect no one to be using them, but let's do a deprecation cycle just to be safe" is not an un-reasonable position to take.

@pierre-haessig Thanks for digging into this! See #13425

@jklymak
Copy link
Member

jklymak commented Mar 3, 2019

Fixed by #13425

@jklymak jklymak closed this as completed Mar 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: consistency Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

No branches or pull requests

5 participants