Skip to content

Commit

Permalink
fix error catching in surge lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
bolliger32 committed Jan 7, 2025
1 parent d2f07d4 commit 5f0c2c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyCIAM/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,14 @@ def _check_vals(rh_diff_arr, lslr_arr, seg):
"(initial adaptation) table if it was generated for a different "
"set of SLR scenarios or years."
)
# lslr is allowed to be below min surge lookup value b/c we created
# lookup such that < min value will be 0 impact
if rh_diff_arr.max() > this_surge_lookup.rh_diff.max():
raise ValueError(error_str.format("rh_diff", "higher", "maximum"))
if rh_diff_arr.min() < this_surge_lookup.rh_diff.min():
raise ValueError(error_str.format("rh_diff", "lower", "minimum"))
if lslr_arr.max() > this_surge_lookup.lslr.max():
raise ValueError(error_str.format("lslr", "higher", "maximum"))
if lslr_arr.min() < this_surge_lookup.lslr.min():
raise ValueError(error_str.format("lslr", "lower", "minimum"))

for seg in inputs.seg.values:
this_surge_lookup = (
Expand Down

0 comments on commit 5f0c2c4

Please sign in to comment.