Skip to content

Commit d92746c

Browse files
committed
add integration test
Signed-off-by: Thijs Baaijen <[email protected]>
1 parent 7eb99ae commit d92746c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/integration/loadflow/test_power_grid_model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
)
2424
from power_grid_model_ds._core.model.arrays.pgm_arrays import TransformerTapRegulatorArray
2525
from power_grid_model_ds._core.model.grids.base import Grid
26+
from power_grid_model_ds._core.utils.misc import array_equal_with_nan
2627
from tests.unit.model.grids.test_custom_grid import CustomGrid
2728

2829
# pylint: disable=missing-function-docstring,missing-class-docstring
@@ -605,3 +606,12 @@ def test_create_extended_grid_without_default_from_input_data(self, input_data_p
605606

606607
with pytest.raises(ValueError, match="Missing required columns: {'extra_field'}"):
607608
core_interface.create_grid_from_input_data()
609+
610+
611+
def test_convert_from_and_to_pgm_data(input_data_pgm):
612+
grid = Grid.from_pgm_data(input_data_pgm)
613+
pgm = PowerGridModelInterface(grid=grid)
614+
pgm.create_input_from_grid()
615+
616+
for array_name in pgm.input_data.keys():
617+
assert array_equal_with_nan(pgm.input_data[array_name], input_data_pgm[array_name])

0 commit comments

Comments
 (0)