Skip to content
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

initial commit: change raise error to print warning #1214

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading