Skip to content

Commit

Permalink
fix: add boundary check just as a precaution
Browse files Browse the repository at this point in the history
  • Loading branch information
baggiponte committed Jun 9, 2024
1 parent 3a78d57 commit a030c56
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions functime/_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ def get_num_rows(
>>> get_num_rows(num_series=5, num_cols=2)
3
"""
if any([num_series < 1, num_cols < 1]):
raise ValueError("Number of series and columns must be a positive integer")

num_rows, remainder = divmod(num_series, num_cols)
if remainder != 0:
return num_rows + 1
Expand Down

0 comments on commit a030c56

Please sign in to comment.