diff --git a/powersimdata/input/tests/test_input_data.py b/powersimdata/input/tests/test_input_data.py index eeaf42a92..9bca6ee94 100644 --- a/powersimdata/input/tests/test_input_data.py +++ b/powersimdata/input/tests/test_input_data.py @@ -2,17 +2,19 @@ from powersimdata.input.input_data import InputData +_input_data = InputData() + def test_get_file_components(): s_info = {"id": "123"} - ct_file = InputData()._get_file_path(s_info, "ct") - grid_file = InputData()._get_file_path(s_info, "grid") + ct_file = _input_data._get_file_path(s_info, "ct") + grid_file = _input_data._get_file_path(s_info, "grid") assert "data/input/123_ct.pkl" == ct_file assert "data/input/123_grid.mat" == grid_file def test_check_field(): - _check_field = InputData()._check_field + _check_field = _input_data._check_field _check_field("grid") _check_field("ct") with pytest.raises(ValueError): diff --git a/powersimdata/scenario/analyze.py b/powersimdata/scenario/analyze.py index 95b3e1b06..0e316b86e 100644 --- a/powersimdata/scenario/analyze.py +++ b/powersimdata/scenario/analyze.py @@ -38,8 +38,8 @@ class Analyze(Ready): def __init__(self, scenario): """Constructor.""" super().__init__(scenario) - self.refresh(scenario) + self._output_data = OutputData() def refresh(self, scenario): print( @@ -112,7 +112,7 @@ def print_infeasibilities(self): ) def _get_data(self, field): - return OutputData().get_data(self._scenario_info["id"], field) + return self._output_data.get_data(self._scenario_info["id"], field) def get_pg(self): """Returns PG data frame.