-
Notifications
You must be signed in to change notification settings - Fork 49
Improve flexibility and robustness of Acoustics Module #433
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
base: develop
Are you sure you want to change the base?
Conversation
…PSDs are calculated
|
Looks like some remaining dependency issues related to timestamps |
akeeste
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jmcvey3! Just two small suggestions on the use of _check_numeric
| raise TypeError("'fn' must be a numeric type (int or float).") | ||
| if not isinstance(fmax, (int, float, np.ndarray)): | ||
| raise TypeError("'fmax' must be a numeric type (int or float).") | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add call to _check_numeric in place of the removed error check
| _check_numeric(fn, "fn") | |
| _check_numeric(fmax, "fmax") |
| if not hasattr(pressure, "sensitivity"): | ||
| _check_numeric(pressure.sensitivity, "pressure.sensitivity") | ||
| if not hasattr(pressure, "fs"): | ||
| _check_numeric(pressure.fs, "pressure.fs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only check that the values are numeric if they exist. If the values are given then the type is not checked:
| if not hasattr(pressure, "sensitivity"): | |
| _check_numeric(pressure.sensitivity, "pressure.sensitivity") | |
| if not hasattr(pressure, "fs"): | |
| _check_numeric(pressure.fs, "pressure.fs") | |
| if hasattr(pressure, "sensitivity"): | |
| _check_numeric(pressure.sensitivity, "pressure.sensitivity") | |
| else | |
| raise TypeError("'pressure.sensitivity' not provided.") | |
| if hasattr(pressure, "fs"): | |
| _check_numeric(pressure.fs, "pressure.fs") | |
| else | |
| raise TypeError("'pressure.fs' not provided.") |
There are three main changes in this pull request:
Minor changes are refactoring some of the argument type checks to clean them up.