diff --git a/edisgo/flex_opt/reinforce_grid.py b/edisgo/flex_opt/reinforce_grid.py index 33b3a5052..25dfdebb4 100644 --- a/edisgo/flex_opt/reinforce_grid.py +++ b/edisgo/flex_opt/reinforce_grid.py @@ -838,17 +838,17 @@ def enhanced_reinforce_grid( standard line type. Should this not be sufficient to solve non-convergence issues, all components in the LV grid are aggregated to the MV/LV station. Default: False. - kwargs : dict - Keyword arguments can be all parameters of function - :func:`edisgo.flex_opt.reinforce_grid.reinforce_grid`, except - `catch_convergence_problems` which will always be set to True, `mode` which - is set to None, and `skip_mv_reinforcement` which will be ignored. separate_lv_grids : bool If True, all highly overloaded LV grids are separated in a first step. separation_threshold : int or float Overloading threshold for LV grid separation. If the overloading is higher than the threshold times the total nominal apparent power of the MV/LV transformer(s) the grid is separated. + kwargs : dict + Keyword arguments can be all parameters of function + :func:`edisgo.flex_opt.reinforce_grid.reinforce_grid`, except + `catch_convergence_problems` which will always be set to True, `mode` which + is set to None, and `skip_mv_reinforcement` which will be ignored. Returns ------- diff --git a/edisgo/flex_opt/reinforce_measures.py b/edisgo/flex_opt/reinforce_measures.py index 4592e0fb3..b93e0f274 100644 --- a/edisgo/flex_opt/reinforce_measures.py +++ b/edisgo/flex_opt/reinforce_measures.py @@ -868,20 +868,18 @@ def add_standard_transformer( transformer_changes = {"added": {}} - transformer_s = grid.transformers_df.iloc[0] - new_transformer_name = transformer_s.name.split("_") + new_transformer_df = grid.transformers_df.iloc[[0]] + new_transformer_name = new_transformer_df.index[0].split("_") grid_id_ind = new_transformer_name.index(str(grid.id)) new_transformer_name[grid_id_ind] = lv_grid_id_new - transformer_s.s_nom = standard_transformer.S_nom - transformer_s.type_info = None - transformer_s.r_pu = standard_transformer.r_pu - transformer_s.x_pu = standard_transformer.x_pu - transformer_s.name = "_".join([str(_) for _ in new_transformer_name]) - transformer_s.bus0 = bus_mv - transformer_s.bus1 = bus_lv - - new_transformer_df = transformer_s.to_frame().T + new_transformer_df.s_nom = standard_transformer.S_nom + new_transformer_df.type_info = None + new_transformer_df.r_pu = standard_transformer.r_pu + new_transformer_df.x_pu = standard_transformer.x_pu + new_transformer_df.index = ["_".join([str(_) for _ in new_transformer_name])] + new_transformer_df.bus0 = bus_mv + new_transformer_df.bus1 = bus_lv old_s_nom = grid.transformers_df.s_nom.sum()