Skip to content

Commit

Permalink
Fix calcultaion of x of trafos according to pypsas base for s_nom
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Aug 16, 2024
1 parent ee6a7c8 commit a9a4a8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/egon/data/datasets/postprocessing_lines_from_nep.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,14 +684,17 @@ def add_transformers(df):
df.set_index("bus1")
.loc[trafos["bus0"][trafos["bus0"].isin(df.bus1)], "s_nom"]
.groupby("bus1")
.max()
.sum()
.values
)

for i in trafos.index:
trafos.loc[i, "s_nom"] = choose_transformer(trafos.loc[i, "s_nom"])[0]
trafos.loc[i, "x"] = choose_transformer(trafos.loc[i, "s_nom"])[1]

# Adjust x of transformers to basis of pypsa
trafos.loc[i, "x"] *= trafos.loc[i, "s_nom"]

trafos["trafo_id"] = trafos.index + max_trafo_id

return trafos, new_buses
Expand Down

0 comments on commit a9a4a8f

Please sign in to comment.