Skip to content

Commit

Permalink
Merge pull request #1214 from PCMDI/feature/1213_mov_research
Browse files Browse the repository at this point in the history
initial commit: change raise error to print warning
  • Loading branch information
lee1043 authored Dec 19, 2024
2 parents 7723ba2 + 4c89ee2 commit 32ea055
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions pcmdi_metrics/variability_mode/variability_modes_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,27 +166,30 @@
elif mode in ["PSA2"]:
eofn_expected = 3
else:
raise ValueError(
f"Mode '{mode}' is not defiend with associated expected EOF number"
print(
f"Warning: Mode '{mode}' is not defined with an associated expected EOF number"
)
eofn_expected = None

if eofn_obs is None:
eofn_obs = eofn_expected
else:
eofn_obs = int(eofn_obs)
if eofn_obs != eofn_expected:
raise ValueError(
f"Observation EOF number ({eofn_obs}) does not match expected EOF number ({eofn_expected}) for mode {mode}"
)
if eofn_expected is not None:
if eofn_obs != eofn_expected:
print(
f"Warning: Observation EOF number ({eofn_obs}) does not match expected EOF number ({eofn_expected}) for mode {mode}"
)

if eofn_mod is None:
eofn_mod = eofn_expected
else:
eofn_mod = int(eofn_mod)
if eofn_mod != eofn_expected:
raise ValueError(
f"Model EOF number ({eofn_mod}) does not match expected EOF number ({eofn_expected}) for mode {mode}"
)
if eofn_expected is not None:
if eofn_mod != eofn_expected:
print(
f"Warning: Model EOF number ({eofn_mod}) does not match expected EOF number ({eofn_expected}) for mode {mode}"
)

print("eofn_obs:", eofn_obs)
print("eofn_mod:", eofn_mod)
Expand Down

0 comments on commit 32ea055

Please sign in to comment.