Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
added raise condition and grouped Tick constructor parameters#26037
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
lib/matplotlib/axis.py Outdated
remaining_kwargs = { | ||
k: v for k, v in kwargs.items() if not k.startswith('grid_')} | ||
if remaining_kwargs: | ||
raise ValueError(f"Invalid kwargs: {remaining_kwargs.keys()}") |
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.
This probably should start as a warning for a cycle? On one hand I hope these is no usage of this in the wild (it is not documented and users should not be makingTick
directly!), but on the other we tend to be very conservative about this sort of thing.
Eitherway, this needs an API change note.
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.
Where and what should I write about in the API change note?
Should I write about changing it to raise in the next cycle?
timhoffm left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
@tacaswell IMHO this does not need an API-change note and could even directly error instead of warn. There is no reasonable code that is currently working and will break through the change. One would have to have passed a different 5-char prefix such asGRID_alpha
/gridsalpha
/line_alpha
. But all of that would be completely made up by the user. That this works is just a current implementation detail and we haven't documented or provided any guarantees on it.
grid_linestyle=None, | ||
grid_linewidth=None, | ||
grid_alpha=None, | ||
size=None, width=None, color=None, major=True, pad=None, zorder=None, # global |
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.
The size in points info must stay.
I'd have a slight preference to keep the one-parameter-per-line format and reorder in there:
# globalsize=None, # pointswidth=None,...# tick propstickdir=None,...
But that's personal taste and not a blocker.
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.
I agree about the size in points comment staying.
I will defer to@timhoffm here and skip the warning/deprecation cycle, but the text of the error raised should explain what is going on and what changed rather than just saying "invalid". |
@madeira-dev Do you want to continue on this? |
PR summary
closes#26008
Grouped constructor parameters as described in issue
and created raise condition
PR checklist