Skip to content

Commit

Permalink
Bug fix avoid float becoming object type
Browse files Browse the repository at this point in the history
  • Loading branch information
birgits committed May 9, 2023
1 parent 20db1e1 commit b7230c1
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions edisgo/flex_opt/reinforce_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b7230c1

Please sign in to comment.