Skip to content

Commit

Permalink
Add check for user_pp_scripts attribute in config object to DaskMulti…
Browse files Browse the repository at this point in the history
…filePP init method
  • Loading branch information
wrongkindofdoctor authored Nov 19, 2024
1 parent 6dd87dc commit 38dcb7c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class PreprocessorFunctionBase(abc.ABC):
function is capable of converting into the format requested by the POD.
- :meth:`process`, which actually implements the data format conversion.
"""

def __init__(self, *args):
"""Called during Preprocessor's init."""
pass
Expand Down Expand Up @@ -1557,11 +1556,12 @@ def __init__(self,
# initialize PreprocessorFunctionBase objects
super().__init__(model_paths, config)
self.file_preproc_functions = [f for f in self._functions]
if any([s for s in config.user_pp_scripts]):
self.add_user_pp_scripts(config)
self.module_root = os.path.join(config.CODE_ROOT, "user_scripts")
else:
self.user_pp_scripts = None
if hasattr(config, 'user_pp_scripts'):
if any([s for s in config.user_pp_scripts]):
self.add_user_pp_scripts(config)
self.module_root = os.path.join(config.CODE_ROOT, "user_scripts")
else:
self.user_pp_scripts = None

def add_user_pp_scripts(self, runtime_config: util.NameSpace):
self.user_pp_scripts = [s for s in runtime_config.user_pp_scripts]
Expand Down

0 comments on commit 38dcb7c

Please sign in to comment.