Skip to content

Commit 933d78e

Browse files
committed
Add test_setup_model
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent 36f3dec commit 933d78e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/integration/loadflow/test_power_grid_model.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,18 @@ def test_batch_run(self):
176176
# Results have been calculated for all 10 scenarios
177177
assert 10 == len(output["line"])
178178

179+
def test_setup_model(self):
180+
"""Test whether a pgm model can be setup with a custom grid"""
181+
grid_generator = RadialGridGenerator(grid_class=CustomGrid, nr_nodes=5, nr_sources=1, nr_nops=0)
182+
grid = grid_generator.run(seed=0)
183+
184+
core_interface = PowerGridModelInterface(grid=grid)
185+
assert core_interface.model is None
186+
assert core_interface.input_data is None
187+
core_interface.setup_model()
188+
assert core_interface.model
189+
assert core_interface.input_data
190+
179191

180192
class TestCreateGridFromInputData:
181193
def test_create_grid_from_input_data(self, input_data_pgm):

0 commit comments

Comments
 (0)