8000 Axes.tick_params() argument checking by timhoffm · Pull Request #12210 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Axes.tick_params() argument checking #12210

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

Merged
merged 1 commit into from
Sep 22, 2018

Conversation

timhoffm
Copy link
Member

PR Summary

Axes.tick_params silently did nothing when an invalid axis parameter was
supplied. This behavior is changed to raise a ValueError instead.

PR Checklist

  • Code is Flake 8 compliant
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

Copy link
Member
@ImportanceOfBeingErnest ImportanceOfBeingErnest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's correct to error instead of silently ignoring non-sensical arguments in this case.

@@ -2949,6 +2949,8 @@ def tick_params(self, axis='both', **kwargs):
also be red. Gridlines will be red and translucent.

"""
if axis not in ['x', 'y', 'both']:
raise ValueError("axis must be one of 'x', 'y' or 'both'.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no dot at end of exception messages (that's both what we do and consistent with the stdlib)

@timhoffm timhoffm force-pushed the axes-tick_params-checking branch from 1b9b4b4 to 2642831 Compare September 22, 2018 11:51
@anntzer anntzer merged commit 03b07fb into matplotlib:master Sep 22, 2018
@timhoffm timhoffm deleted the axes-tick_params-checking branch September 22, 2018 14:58
@QuLogic QuLogic added this to the v3.1 milestone Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0