Skip to content
Merged
Changes from all commits
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
13 changes: 8 additions & 5 deletions fooof/sim/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,16 @@ def _check_values(start, stop, step):
If the given values for defining the iteration range are inconsistent.
"""

if any(ii < 0 for ii in [start, stop, step]):
raise ValueError("Inputs 'start', 'stop', and 'step' should all be positive values.")
if any(ii < 0 for ii in [start, stop]):
raise ValueError("Inputs 'start' and 'stop' should be positive values.")

if not start < stop:
raise ValueError("Input 'start' should be less than 'stop'.")
if (stop - start) * step < 0:
raise ValueError("The sign of input 'step' does not align with 'start' / 'stop' values.")

if not step < (stop - start):
if start == stop:
raise ValueError("Input 'start' and 'stop' must be different values.")

if not abs(step) < abs(stop - start):
raise ValueError("Input 'step' is too large given values for 'start' and 'stop'.")


Expand Down