[run_selector] remove dependency to pp_params
This commit is contained in:
+4
-5
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user