@@ -115,7 +115,7 @@ def create_input_data():
115115 create_input_data_mock .side_effect = create_input_data
116116
117117 # Act
118- result = converter ._parse_data (data = {"bus" : pd .DataFrame ()}, data_type = " input" , extra_info = None )
118+ result = converter ._parse_data (data = {"bus" : pd .DataFrame ()}, data_type = DatasetType . input , extra_info = None )
119119
120120 # Assert
121121 create_input_data_mock .assert_called_once_with ()
@@ -138,7 +138,7 @@ def test_parse_data__extra_info(
138138 extra_info = MagicMock ("extra_info" )
139139
140140 # Act
141- converter ._parse_data (data = {}, data_type = " input" , extra_info = extra_info )
141+ converter ._parse_data (data = {}, data_type = DatasetType . input , extra_info = extra_info )
142142
143143 # Assert
144144 create_input_data_mock .assert_called_once_with ()
@@ -152,7 +152,7 @@ def test_parse_data__update_data():
152152
153153 # Act/Assert
154154 with pytest .raises (ValueError ):
155- converter ._parse_data (data = {}, data_type = " update" , extra_info = None )
155+ converter ._parse_data (data = {}, data_type = DatasetType . update , extra_info = None )
156156
157157
158158def test_fill_pgm_extra_info ():
@@ -442,9 +442,9 @@ def test_create_input_data():
442442 ("create_fn" , "table" ),
443443 [
444444 (PandaPowerConverter ._create_pgm_input_nodes , "bus" ),
445- (PandaPowerConverter ._create_pgm_input_lines , " line" ),
445+ (PandaPowerConverter ._create_pgm_input_lines , ComponentType . line ),
446446 (PandaPowerConverter ._create_pgm_input_sources , "ext_grid" ),
447- (PandaPowerConverter ._create_pgm_input_shunts , " shunt" ),
447+ (PandaPowerConverter ._create_pgm_input_shunts , ComponentType . shunt ),
448448 (PandaPowerConverter ._create_pgm_input_sym_gens , "sgen" ),
449449 (PandaPowerConverter ._create_pgm_input_sym_loads , "load" ),
450450 (PandaPowerConverter ._create_pgm_input_transformers , "trafo" ),
@@ -481,7 +481,7 @@ def test_create_pgm_input_nodes(mock_init_array: MagicMock, two_pp_objs: MockDf,
481481 converter ._generate_ids .assert_called_once_with ("bus" , two_pp_objs .index )
482482
483483 # initialization
484- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .node , shape = 2 )
484+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .node , shape = 2 )
485485
486486 # retrieval
487487 converter ._get_pp_attr .assert_any_call ("bus" , "vn_kv" , expected_type = "f8" )
@@ -514,7 +514,7 @@ def test_create_pgm_input_lines(mock_init_array: MagicMock, two_pp_objs, convert
514514 converter ._get_pgm_ids .assert_any_call ("bus" , _get_pp_attr ("line" , "to_bus" , expected_type = "u4" ))
515515
516516 # initialization
517- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .line , shape = 2 )
517+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .line , shape = 2 )
518518
519519 # retrieval
520520 converter ._get_pp_attr .assert_any_call ("line" , "from_bus" , expected_type = "u4" )
@@ -606,7 +606,7 @@ def test_create_pgm_input_sources(mock_init_array: MagicMock, two_pp_objs, conve
606606 converter ._generate_ids .assert_called_once_with ("ext_grid" , two_pp_objs .index )
607607
608608 # initialization
609- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .source , shape = 2 )
609+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .source , shape = 2 )
610610
611611 # retrieval:
612612 converter ._get_pp_attr .assert_any_call ("ext_grid" , "bus" , expected_type = "u4" )
@@ -671,7 +671,7 @@ def test_create_pgm_input_sym_loads(mock_init_array: MagicMock, two_pp_objs, con
671671 # administration:
672672
673673 # initialization
674- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .sym_load , shape = 3 * 2 )
674+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .sym_load , shape = 3 * 2 )
675675
676676 # retrieval:
677677 converter ._get_pp_attr .assert_any_call ("load" , "bus" , expected_type = "u4" )
@@ -708,7 +708,7 @@ def test_create_pgm_input_asym_loads(mock_init_array: MagicMock, two_pp_objs, co
708708 converter ._generate_ids .assert_called_once_with ("asymmetric_load" , two_pp_objs .index )
709709
710710 # initialization
711- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .asym_load , shape = 2 )
711+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .asym_load , shape = 2 )
712712
713713 # retrieval:
714714 converter ._get_pp_attr .assert_any_call ("asymmetric_load" , "bus" , expected_type = "u4" )
@@ -801,7 +801,7 @@ def test_create_pgm_input_shunts(mock_init_array: MagicMock, two_pp_objs, conver
801801 converter ._generate_ids .assert_called_once_with (ComponentType .shunt , two_pp_objs .index )
802802
803803 # initialization
804- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .shunt , shape = 2 )
804+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .shunt , shape = 2 )
805805
806806 # retrieval:
807807 converter ._get_pp_attr .assert_any_call (ComponentType .shunt , "bus" , expected_type = "u4" )
@@ -868,7 +868,7 @@ def test_create_pgm_input_transformers(mock_init_array: MagicMock, two_pp_objs,
868868 )
869869
870870 # initialization
871- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .transformer , shape = 2 )
871+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .transformer , shape = 2 )
872872
873873 # retrieval:
874874 converter ._get_pp_attr .assert_any_call ("trafo" , "hv_bus" , expected_type = "u4" )
@@ -1017,7 +1017,7 @@ def test_create_pgm_input_sym_gens(mock_init_array: MagicMock, two_pp_objs, conv
10171017 converter ._generate_ids .assert_called_once_with ("sgen" , two_pp_objs .index )
10181018
10191019 # initialization
1020- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .sym_gen , shape = 2 )
1020+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .sym_gen , shape = 2 )
10211021
10221022 # retrieval:
10231023 converter ._get_pp_attr .assert_any_call ("sgen" , "bus" , expected_type = "i8" )
@@ -1110,7 +1110,7 @@ def test_create_pgm_input_asym_gens(mock_init_array: MagicMock, two_pp_objs, con
11101110 converter ._generate_ids .assert_called_once_with ("asymmetric_sgen" , two_pp_objs .index )
11111111
11121112 # initialization
1113- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .asym_gen , shape = 2 )
1113+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .asym_gen , shape = 2 )
11141114
11151115 # retrieval:
11161116 converter ._get_pp_attr .assert_any_call ("asymmetric_sgen" , "bus" , expected_type = "i8" )
@@ -1162,7 +1162,7 @@ def test_create_pgm_input_three_winding_transformers(mock_init_array: MagicMock,
11621162
11631163 # initialization
11641164 mock_init_array .assert_called_once_with (
1165- data_type = " input" , component_type = ComponentType .three_winding_transformer , shape = 2
1165+ data_type = DatasetType . input , component_type = ComponentType .three_winding_transformer , shape = 2
11661166 )
11671167
11681168 # retrieval:
@@ -1521,7 +1521,7 @@ def test_create_pgm_input_links(mock_init_array: MagicMock, converter):
15211521 pd .testing .assert_index_equal (converter ._generate_ids .call_args_list [0 ].args [1 ], pd .Index ([1 , 3 ]))
15221522
15231523 # initialization
1524- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .link , shape = 2 )
1524+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .link , shape = 2 )
15251525
15261526 # assignment:
15271527 pgm : MagicMock = mock_init_array .return_value .__setitem__
@@ -1581,7 +1581,7 @@ def test_create_pgm_input_wards(mock_init_array: MagicMock, two_pp_objs, convert
15811581 # administration:
15821582
15831583 # initialization
1584- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .sym_load , shape = 2 * 2 )
1584+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .sym_load , shape = 2 * 2 )
15851585
15861586 # retrieval:
15871587 converter ._get_pp_attr .assert_any_call ("ward" , "bus" , expected_type = "u4" )
@@ -1678,7 +1678,7 @@ def test_create_pgm_input_motors(mock_init_array: MagicMock, two_pp_objs, conver
16781678 converter ._generate_ids .assert_called_once_with ("motor" , two_pp_objs .index , name = "motor_load" )
16791679
16801680 # initialization
1681- mock_init_array .assert_called_once_with (data_type = " input" , component_type = ComponentType .sym_load , shape = 2 )
1681+ mock_init_array .assert_called_once_with (data_type = DatasetType . input , component_type = ComponentType .sym_load , shape = 2 )
16821682
16831683 # retrieval:
16841684 converter ._get_pp_attr .assert_any_call ("motor" , "bus" , expected_type = "i8" )
0 commit comments