Skip to content

Commit 9afbbb5

Browse files
committed
Make PowerGridModelInterface._setup_model a public method
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent df324f4 commit 9afbbb5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/power_grid_model_ds/_core/load_flow.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def calculate_power_flow(
9595
9696
Returns output of the power flow calculation (also stored in self.output_data)
9797
"""
98-
self.model = self.model or self._setup_model()
98+
self.model = self.model or self.setup_model()
9999

100100
self.output_data = self.model.calculate_power_flow(
101101
calculation_method=calculation_method, update_data=update_data, **kwargs
@@ -134,7 +134,7 @@ def update_model(self, update_data: Dict):
134134
135135
136136
"""
137-
self.model = self.model or self._setup_model()
137+
self.model = self.model or self.setup_model()
138138
self.model.update(update_data=update_data)
139139

140140
def update_grid(self) -> None:
@@ -154,7 +154,8 @@ def update_grid(self) -> None:
154154
def _match_dtypes(first_dtype: np.dtype, second_dtype: np.dtype):
155155
return list(set(first_dtype.names).intersection(set(second_dtype.names))) # type: ignore[arg-type]
156156

157-
def _setup_model(self):
157+
def setup_model(self):
158+
"""Setup the PowerGridModel with the input data."""
158159
self.input_data = self.input_data or self.create_input_from_grid()
159160
self.model = PowerGridModel(self.input_data, system_frequency=self.system_frequency)
160161
return self.model

0 commit comments

Comments
 (0)