-
Notifications
You must be signed in to change notification settings - Fork 4
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
Improving readability/consistency of errors/exceptions in gempyor (second batch) #387
Changes from 56 commits
f67d3bc
141a627
1fe2d4b
90b3618
1934338
a6c3585
e2a87c3
17a4f38
3acad12
44ccc84
b32c64e
d844ced
2cbf2ed
a1692a1
759795f
df784d5
8ec6c05
d760ddc
7e19700
452ddbb
99d2f36
47514d5
97d3996
918ebc7
764c4b2
c1e79c2
4fd1b11
2e62ae3
e5772c7
8fe918a
f7e53a7
d5fe360
9c6e1f1
f7c1ad0
ebe2ebc
57240be
cc52fb7
328dacf
e7621d9
d74a214
d508793
6fc2a5a
f8b9dc3
ad623ab
a3b5f62
1daed72
239f5a0
50b91ce
84fb067
4bf61fb
660795f
00120cf
0a05cb5
190c483
fb6c9ed
8255da2
8a5e772
6ce1760
178861a
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 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -278,8 +278,11 @@ def steps_SEIR_nb( | |||||||||||||||||||
print(" ", states_current[comp].max()) | ||||||||||||||||||||
|
||||||||||||||||||||
if (states_current.min() < 0) or (states_current.max() > 10**10): | ||||||||||||||||||||
print((states_current.min() < 0), (states_current.max() > 10**10)) | ||||||||||||||||||||
raise ValueError(f"Overflow error. Too small ?. Too large ?") | ||||||||||||||||||||
raise ValueError( | ||||||||||||||||||||
f"State values are outside the valid range. " | ||||||||||||||||||||
f"Minimum value: '{states_current.min()}', Maximum value: '{states_current.max()}'. " | ||||||||||||||||||||
f"Valid range is between 0 and {10**10}." | ||||||||||||||||||||
) | ||||||||||||||||||||
Comment on lines
+281
to
+285
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can I push back on this a little? I feel like the adjustment I made is easy to read (but maybe that's just my brain). Do you feel strongly about this adjustment? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i do not feel strongly. |
||||||||||||||||||||
|
||||||||||||||||||||
return states, states_daily_incid | ||||||||||||||||||||
|
||||||||||||||||||||
|
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.
mild code smell that this exactly duplicates earlier lines 588 ish - extract as helper function, maybe?