Skip to content
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

[MNT] - Update parameter Stepper object #295

Merged
merged 1 commit into from
Jul 25, 2023
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