Skip to content

Commit

Permalink
Bug fixes to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Erdmann committed Feb 27, 2025
1 parent fa97a35 commit 444331a
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions pysteps/postprocessing/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
"""
import importlib

# from pysteps.postprocessing import diagnostics, ensemblestats
from pysteps import postprocessing as pp
from pysteps.postprocessing import diagnostics, ensemblestats
from pprint import pprint
import warnings

_diagnostics_methods = dict()

_ensemblestats_methods = dict(
mean=pp.ensemblestats.mean,
excprob=pp.ensemblestats.excprob,
banddepth=pp.ensemblestats.banddepth,
mean=ensemblestats.mean,
excprob=ensemblestats.excprob,
banddepth=ensemblestats.banddepth,
)


Expand Down Expand Up @@ -52,17 +52,19 @@ def add_postprocessor(
if short_name not in methods_dict:
methods_dict[short_name] = _postprocessors
else:
RuntimeWarning(
warnings.warn(
f"The {module} identifier '{short_name}' is already available in "
f"'pysteps.postprocessing.interface_{module}_methods'.\n"
f"Skipping {module}:{'.'.join(attributes)}"
f"Skipping {module}:{'.'.join(attributes)}",
RuntimeWarning,
)

if hasattr(globals()[module], postprocessors_function_name):
RuntimeWarning(
warnings.warn(
f"The {module} function '{short_name}' is already an attribute"
f"of 'pysteps.postprocessing.{module}'.\n"
f"Skipping {module}:{'.'.join(attributes)}"
f"Skipping {module}:{'.'.join(attributes)}",
RuntimeWarning,
)
else:
setattr(globals()[module], postprocessors_function_name, _postprocessors)
Expand Down

0 comments on commit 444331a

Please sign in to comment.