1010import pytest
1111from power_grid_model import ComponentType , DatasetType , initialize_array
1212
13- from power_grid_model_io .converters .pandapower_converter import PandaPowerConverter
13+ from power_grid_model_io .converters .pandapower_converter import PandaPowerConverter , get_loss_params_3ph
1414from tests .utils import MockDf
1515
1616
@@ -895,6 +895,7 @@ def test_output_line_3ph(converter):
895895 mock_pgm_array .__getitem__ .assert_any_call ("i_to" )
896896
897897 # assignment
898+ loss_params = get_loss_params_3ph ()
898899 mock_pp_df .return_value .__setitem__ .assert_any_call ("p_a_from_mw" , ANY )
899900 mock_pp_df .return_value .__setitem__ .assert_any_call ("q_a_from_mvar" , ANY )
900901 mock_pp_df .return_value .__setitem__ .assert_any_call ("p_a_to_mw" , ANY )
@@ -907,12 +908,12 @@ def test_output_line_3ph(converter):
907908 mock_pp_df .return_value .__setitem__ .assert_any_call ("q_c_from_mvar" , ANY )
908909 mock_pp_df .return_value .__setitem__ .assert_any_call ("p_c_to_mw" , ANY )
909910 mock_pp_df .return_value .__setitem__ .assert_any_call ("q_c_to_mvar" , ANY )
910- mock_pp_df .return_value .__setitem__ .assert_any_call ("p_a_l_mw" , ANY )
911- mock_pp_df .return_value .__setitem__ .assert_any_call ("p_b_l_mw" , ANY )
912- mock_pp_df .return_value .__setitem__ .assert_any_call ("p_c_l_mw" , ANY )
913- mock_pp_df .return_value .__setitem__ .assert_any_call ("q_a_l_mvar" , ANY )
914- mock_pp_df .return_value .__setitem__ .assert_any_call ("q_b_l_mvar" , ANY )
915- mock_pp_df .return_value .__setitem__ .assert_any_call ("q_c_l_mvar" , ANY )
911+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 0 ] , ANY )
912+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 2 ] , ANY )
913+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 4 ] , ANY )
914+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 1 ] , ANY )
915+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 3 ] , ANY )
916+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 5 ] , ANY )
916917 mock_pp_df .return_value .__setitem__ .assert_any_call ("i_a_from_ka" , ANY )
917918 mock_pp_df .return_value .__setitem__ .assert_any_call ("i_b_from_ka" , ANY )
918919 mock_pp_df .return_value .__setitem__ .assert_any_call ("i_c_from_ka" , ANY )
@@ -1017,6 +1018,7 @@ def test_output_trafos_3ph__current(converter):
10171018 mock_pgm_array .__getitem__ .assert_any_call ("i_to" )
10181019
10191020 # assignment
1021+ loss_params = get_loss_params_3ph ()
10201022 mock_pp_df .return_value .__setitem__ .assert_any_call ("p_a_hv_mw" , ANY )
10211023 mock_pp_df .return_value .__setitem__ .assert_any_call ("q_a_hv_mvar" , ANY )
10221024 mock_pp_df .return_value .__setitem__ .assert_any_call ("p_a_lv_mw" , ANY )
@@ -1029,12 +1031,12 @@ def test_output_trafos_3ph__current(converter):
10291031 mock_pp_df .return_value .__setitem__ .assert_any_call ("q_c_hv_mvar" , ANY )
10301032 mock_pp_df .return_value .__setitem__ .assert_any_call ("p_c_lv_mw" , ANY )
10311033 mock_pp_df .return_value .__setitem__ .assert_any_call ("q_c_lv_mvar" , ANY )
1032- mock_pp_df .return_value .__setitem__ .assert_any_call ("p_a_l_mw" , ANY )
1033- mock_pp_df .return_value .__setitem__ .assert_any_call ("p_b_l_mw" , ANY )
1034- mock_pp_df .return_value .__setitem__ .assert_any_call ("p_c_l_mw" , ANY )
1035- mock_pp_df .return_value .__setitem__ .assert_any_call ("q_a_l_mvar" , ANY )
1036- mock_pp_df .return_value .__setitem__ .assert_any_call ("q_b_l_mvar" , ANY )
1037- mock_pp_df .return_value .__setitem__ .assert_any_call ("q_c_l_mvar" , ANY )
1034+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 0 ] , ANY )
1035+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 2 ] , ANY )
1036+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 4 ] , ANY )
1037+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 1 ] , ANY )
1038+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 3 ] , ANY )
1039+ mock_pp_df .return_value .__setitem__ .assert_any_call (loss_params [ 5 ] , ANY )
10381040 mock_pp_df .return_value .__setitem__ .assert_any_call ("i_a_hv_ka" , ANY )
10391041 mock_pp_df .return_value .__setitem__ .assert_any_call ("i_b_hv_ka" , ANY )
10401042 mock_pp_df .return_value .__setitem__ .assert_any_call ("i_c_hv_ka" , ANY )
0 commit comments