Skip to content

Commit

Permalink
Improve verification interface get method
Browse files Browse the repository at this point in the history
  • Loading branch information
albertocarpentieri authored Aug 28, 2022
1 parent 94a11b3 commit 1f4737e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pysteps/verification/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def get_method(name, type="deterministic"):
name = name.lower()
type = type.lower()

if type in ["deterministic"]:
if type == "deterministic":

from .detcatscores import det_cat_fct
from .detcontscores import det_cont_fct
Expand Down Expand Up @@ -213,38 +213,38 @@ def f(fct, obs, **kwargs):
return f

# spatial
elif name in ["binary_mse"]:
elif name == "binary_mse":
return binary_mse
elif name in ["fss"]:
elif name == "fss":
return fss
elif name in ["sal"]:
elif name == "sal":
return sal

else:
raise ValueError("unknown deterministic method %s" % name)

elif type in ["ensemble"]:
elif type == "ensemble":

from .ensscores import ensemble_skill, ensemble_spread, rankhist

if name in ["ens_skill"]:
if name == "ens_skill":
return ensemble_skill
elif name in ["ens_spread"]:
elif name == "ens_spread":
return ensemble_spread
elif name in ["rankhist"]:
elif name == "rankhist":
return rankhist
else:
raise ValueError("unknown ensemble method %s" % name)

elif type in ["probabilistic"]:
elif type == "probabilistic":

from .probscores import CRPS, reldiag, ROC_curve

if name in ["crps"]:
if name == "crps":
return CRPS
elif name in ["reldiag"]:
elif name == "reldiag":
return reldiag
elif name in ["roc"]:
elif name == "roc":
return ROC_curve
else:
raise ValueError("unknown probabilistic method %s" % name)
Expand Down

0 comments on commit 1f4737e

Please sign in to comment.