diff --git a/comparator.py b/comparator.py index 437445c..05a377c 100644 --- a/comparator.py +++ b/comparator.py @@ -47,7 +47,9 @@ class Comparator(Aggregator, HDF5Container): # Select runs if selector is None: - selector = RunSelector(path, in_runs, in_nums, self.pp_params, **kwargs) + selector = RunSelector( + path, in_runs, in_nums, self.pp_params.input.nml_filename, **kwargs + ) # Save infos self.path = path diff --git a/plotter.py b/plotter.py index 52b2ce2..8bb0c2b 100644 --- a/plotter.py +++ b/plotter.py @@ -151,7 +151,7 @@ class Plotter(Aggregator, BaseProcessor): # Select runs if selector is None: self.selector = RunSelector( - path, in_runs, in_nums, self.pp_params, **kwargs + path, in_runs, in_nums, self.pp_params.input.nml_filename, **kwargs ) else: self.selector = selector diff --git a/run_selector.py b/run_selector.py index d056dde..9385b38 100644 --- a/run_selector.py +++ b/run_selector.py @@ -10,8 +10,6 @@ import numpy as np import yaml import f90nml -from pp_params import default_params - class NamelistRecursive: def __init__(self, namelist): @@ -44,7 +42,7 @@ class RunSelector: path_in, in_runs=None, in_nums="all", - pp_params=default_params(), + nml_filename="run.nml", filter_name="*", filter_nml={}, sort_run_by=None, @@ -71,6 +69,7 @@ class RunSelector: "last" select only the last output. "all" preselect all outputs (default) + nml_filename : str name of the namelist (should be the same for all outputs) filter_name : str, filter runs by name. Default "*" filter_nml : tuple or list of tupple. @@ -91,7 +90,7 @@ class RunSelector: """ self.path_in = path_in - self.pp_params = pp_params + self.nml_filename = nml_filename self.namelist = {} self.runs = self.get_runs(in_runs, filter_name, filter_nml, sort_run_by) @@ -194,7 +193,7 @@ class RunSelector: def load_namelist(self, run): path_run = self.path_in + "/" + run - path_nml = path_run + "/" + self.pp_params.input.nml_filename + path_nml = path_run + "/" + self.nml_filename return NamelistRecursive(f90nml.read(path_nml)) def get_nml_value(self, nml_key, run):