Skip to content

Commit 37389f1

Browse files
committed
change configs to config
1 parent e297081 commit 37389f1

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

PyStemmusScope/stemmus_scope.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
import logging
44
import os
55
import subprocess
6-
from typing import Any
7-
from typing import Iterable
8-
from typing import Tuple
6+
from typing import Dict
97
from . import config_io
108
from . import forcing_io
119
from . import soil_io
@@ -97,6 +95,6 @@ def run(self) -> str:
9795

9896

9997
@property
100-
def configs(self) -> Iterable[Tuple[str, Any]]:
98+
def config(self) -> Dict:
10199
"""Return the configurations for this model."""
102100
return self._configs

tests/test_stemmus_scope.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ def test_setup(self, model_with_setup):
3737
actual_output_dir = data_folder / "directories" / "output" / "XX-dummy_2022-07-11-1200"
3838
actual_cfg_file = str(actual_input_dir / "XX-dummy_2022-07-11-1200_config.txt")
3939

40-
assert actual_input_dir == Path(model.configs["InputPath"])
41-
assert actual_output_dir == Path(model.configs["OutputPath"])
40+
assert actual_input_dir == Path(model.config["InputPath"])
41+
assert actual_output_dir == Path(model.config["OutputPath"])
4242
assert actual_cfg_file == cfg_file
4343

4444
# matlab log dir
45-
assert os.environ['MATLAB_LOG_DIR'] == str(model.configs["InputPath"])
45+
assert os.environ['MATLAB_LOG_DIR'] == str(model.config["InputPath"])
4646

4747
@patch("subprocess.run")
4848
def test_run(self, mocked_run, model_with_setup):
@@ -96,18 +96,18 @@ def test_setup(self, model_with_setup, tmp_path):
9696
actual_output_dir = tmp_path / "output" / "dummy_2022-07-11-1200"
9797
actual_cfg_file = str(actual_input_dir / "dummy_2022-07-11-1200_config.txt")
9898

99-
assert actual_input_dir == Path(model.configs["InputPath"])
100-
assert actual_output_dir == Path(model.configs["OutputPath"])
99+
assert actual_input_dir == Path(model.config["InputPath"])
100+
assert actual_output_dir == Path(model.config["OutputPath"])
101101
assert actual_cfg_file == cfg_file
102-
assert model.configs["NumberOfTimeSteps"] == "5"
102+
assert model.config["NumberOfTimeSteps"] == "5"
103103

104104
# matlab log dir
105-
assert os.environ['MATLAB_LOG_DIR'] == str(model.configs["InputPath"])
105+
assert os.environ['MATLAB_LOG_DIR'] == str(model.config["InputPath"])
106106

107-
def test_configs(self, model_with_setup):
107+
def test_config(self, model_with_setup):
108108
model, cfg_file = model_with_setup
109109
actual = config_io.read_config(cfg_file)
110-
assert actual == model.configs
110+
assert actual == model.config
111111

112112
@patch("subprocess.run")
113113
def test_run(self, mocked_run, model_with_setup, tmp_path):

0 commit comments

Comments
 (0)