Skip to content

Commit 6784819

Browse files
remove constants.py and related variables in other modules
1 parent 151da29 commit 6784819

File tree

5 files changed

+4
-21
lines changed

5 files changed

+4
-21
lines changed

expts_manager/experiment_manager_tool/configuration_updater/f90nml_updater.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import os
22
import numpy as np
33
import f90nml
4-
from experiment_manager_tool.utils import constants
54
from experiment_manager_tool.utils.util_functions import get_namelist_group
65

76
class f90nmlUpdater:
8-
def __init__(self):
9-
self.combo_suffix = constants.COMBO_SUFFIX
107

118
def update_nml_params(self, expt_path, param_dict, parameter_block, append_group_list: list =None, indx=None) -> None:
129
"""

expts_manager/experiment_manager_tool/manager/perturb_experiment.py

-3
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ def _process_params_cross_files(self, filename: str, filecontent: dict) -> None:
106106
for groupname, name_dict in filecontent.items():
107107
self.tmp_count += 1
108108

109-
if not groupname.endswith(self.combo_suffix):
110-
continue
111-
112109
if name_dict:
113110
self._generate_combined_dicts(groupname, name_dict, filename)
114111
self.setup_expts(filename)
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
from experiment_manager_tool.utils.ryaml_handler import read_yaml
3-
from experiment_manager_tool.utils import constants
43

54
class BaseManager:
65
"""
@@ -12,10 +11,11 @@ def __init__(self, yamlfile: str) -> None:
1211
self._load_variables(self.yamlfile)
1312

1413
def _load_variables(self, yamlfile: str) -> None:
14+
print(yamlfile)
1515
self.indata = read_yaml(yamlfile)
16+
print(self.indata)
1617
self.dir_manager = os.getcwd()
1718
self.test_path = self.indata.get("test_path")
1819
self.model = self.indata.get("model")
19-
20-
self.combo_suffix = constants.COMBO_SUFFIX
21-
self.branch_perturb = constants.BRANCH_PERTURB
20+
21+
self.branch_perturb = "perturb"
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
MOM_PREFIX = "MOM_list"
2-
CONFIG_PREFIX = "config_list"
3-
RUNCONFIG_SUFFIX1 = "_attributes"
4-
RUNCONFIG_SUFFIX2 = "_modelio"
5-
NML_SUFFIX = "_nml"
6-
RUNSEQ_PREFIX = "runseq_list"
7-
COMBO_SUFFIX = "_combo"
81
BRANCH_PERTURB = "perturb"

expts_manager/experiment_manager_tool/utils/util_functions.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import subprocess
22
import os
3-
from experiment_manager_tool.utils import constants
43

54
def update_diag_table(path: str, diag_path: str, diag_flag: bool, model: str) -> None:
65
if diag_flag and diag_path:
@@ -24,9 +23,6 @@ def copy_diag_table(diag_path: str, path: str) -> None:
2423

2524
def get_namelist_group(list_of_groupname: list[str], indx: int) -> str:
2625
nml_group = list_of_groupname[indx]
27-
# rename the namlist by removing the suffix if the suffix with `_combo`
28-
if nml_group.endswith(constants.COMBO_SUFFIX):
29-
nml_group = nml_group[: -len(constants.COMBO_SUFFIX)]
3026
return nml_group
3127

3228
def create_nested_dict(outer_key: str, inner_dict: dict[str, dict]) -> dict[str, dict]:

0 commit comments

Comments
 (0)