Skip to content

Add parameter checks to DayLocator initiator #6955

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 4 commits into from
Aug 22, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Consolidate DayLocator interval checks
  • Loading branch information
LindyBalboa committed Aug 21, 2016
commit b5c9aa416956918447220c338a8933c2d5cb77f4
8 changes: 2 additions & 6 deletions lib/matplotlib/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,12 +1241,8 @@ def __init__(self, bymonthday=None, interval=1, tz=None):

Default is to tick every day of the month: ``bymonthday=range(1,32)``
"""
if interval < 1:
raise ValueError("The interval parameter must be an integer "
"greater than or equal to one.")
if not isinstance(interval, int):
raise ValueError("The interval parameter must be an integer "
"greater than or equal to one.")
if not interval == int(interval) or interval < 1:
raise ValueError("interval must be an integer greater than 0")
if bymonthday is None:
bymonthday = range(1, 32)
elif isinstance(bymonthday, np.ndarray):
Expand Down