Skip to content

Incosistent keyword arguments #16747

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
Prukutu opened this issue Mar 12, 2020 · 4 comments
Closed

Incosistent keyword arguments #16747

Prukutu opened this issue Mar 12, 2020 · 4 comments

Comments

@Prukutu
Copy link

Prukutu commented Mar 12, 2020

Bug report

Bug summary

There is some very frustrating inconsistencies in keyword arguments names across the library. One notable (to me) example is "ncol" and "ncols" as found in matplotlib.gridspec.GridSpec and matplotlib.axes.Axes.legend, respectively.

Not a big issue, but I'm sure I'm not the only one consistently getting mixed up!

Matplotlib version

  • Operating system: Ubuntu
  • Matplotlib version: 3.03
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 3.7.3

Installed matplotlib and python via a pip virtualenv

@timhoffm
Copy link
Member

Thanks for the feedback. We know that matplotlib unfortunately has some inconsistencies in its API. Matplotlib has been developed by different people over a very long time, and API consistency and design has not always been watched for as strongly as we do nowadays.
Today we have to make a trade off between improving the existing API and breaking changes we would introduce with that. Given that there are millions of users, we have to be very conservative with breaking changes.

@TAdeJong
Copy link

Just weighing in here with my opinion (Instead of opening a new issue: https://twitter.com/sjvrijn/status/1395746154223181828 ) The ncol in legend() versus by now pretty consistently used ncols elsewhere is, I feel, an example that might be worth changing by now, or at least start accepting ncols as well...
Maybe as a "good first issue"?
Or is it worthwhile to start collecting a list of such minor inconsistencies to target for a next release (more explicitly than the label does)?

@anntzer
Copy link
Contributor

anntzer commented May 21, 2021

For the specific case of here I would agree with making ncols a synonym for ncol (or rather having ncols be the canonical name). This can be done using _api.rename_parameter with a small modification to allow having just the renaming effect, but never emitting a deprecation.

@oscargus
Copy link
Member

oscargus commented Mar 9, 2023

@oscargus oscargus closed this as completed Mar 9, 2023
@oscargus oscargus added this to the v3.6.0 milestone Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants