Skip to content

Commit

Permalink
Updating steps_source.py and utils.py
Browse files Browse the repository at this point in the history
There were not that many changes in the final batch of error improvements, so I went ahead and lumped them in with batch two.
  • Loading branch information
emprzy committed Nov 20, 2024
1 parent e5772c7 commit 8fe918a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions flepimop/gempyor_pkg/src/gempyor/steps_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}."
)

return states, states_daily_incid

Expand Down
4 changes: 2 additions & 2 deletions flepimop/gempyor_pkg/src/gempyor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def write_df(
None
Raises:
ValueError: The given output extension is not supported yet.
NotImplementedError: The given output extension is not supported yet.
"""
# Decipher the path given
fname = fname.decode() if isinstance(fname, bytes) else fname
Expand Down Expand Up @@ -82,7 +82,7 @@ def read_df(
A pandas DataFrame parsed from the file given.
Raises:
ValueError: The given output extension is not supported yet.
NotImplementedError: The given output extension is not supported yet.
"""
# Decipher the path given
fname = fname.decode() if isinstance(fname, bytes) else fname
Expand Down

0 comments on commit 8fe918a

Please sign in to comment.