-
Notifications
You must be signed in to change notification settings - Fork 0
Remove redundant asserts #95
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: pegasus
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -171,12 +171,6 @@ def gcmt_to_realisation( | |||||
| strike2 = gcmt_solutions.at[gcmt_event_id, "strike2"] | ||||||
| dip2 = gcmt_solutions.at[gcmt_event_id, "dip2"] | ||||||
| rake2 = gcmt_solutions.at[gcmt_event_id, "rake2"] | ||||||
| assert isinstance(strike1, float | int) | ||||||
| assert isinstance(dip1, float | int) | ||||||
| assert isinstance(rake1, float | int) | ||||||
| assert isinstance(strike2, float | int) | ||||||
| assert isinstance(dip2, float | int) | ||||||
| assert isinstance(rake2, float | int) | ||||||
| nodal_plane_1 = NodalPlane(strike1, dip1, rake1) | ||||||
| nodal_plane_2 = NodalPlane(strike2, rake2, dip2) | ||||||
|
||||||
| nodal_plane_2 = NodalPlane(strike2, rake2, dip2) | |
| nodal_plane_2 = NodalPlane(strike2, dip2, rake2) |
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.
This PR removes type asserts for strike/dip/rake because pandas returns
np.float64, but there are still asserts later in this function (assert isinstance(magnitude, float)andassert isinstance(centroid_depth, float)) that will also fail fornp.float64(and potentiallyint). Consider removing these asserts too, or replacing them with anumbers.Real/np.floatingcheck or explicitfloat(...)conversion at the point of use.