Skip to content

Commit

Permalink
fix positions of foreign clustered buses
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosEpia committed Nov 4, 2024
1 parent af4b038 commit ba947a6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions etrago/execute/market_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,18 @@ def build_market_model(self):
)

net = clustering.network

# Adjust positions foreign buses
foreign = self.network.buses[self.network.buses.country != "DE"].copy()
foreign = foreign[foreign.index.isin(self.network.loads.bus)]
foreign = foreign.drop_duplicates(subset="country")
foreign = foreign.set_index("country")

for country in foreign.index:
bus_for = net.buses.index[net.buses.country == country]
net.buses.loc[bus_for, "x"] = foreign.at[country, "x"]
net.buses.loc[bus_for, "y"] = foreign.at[country, "y"]

# links_col = net.links.columns
ac = net.lines[net.lines.carrier == "AC"]
str1 = "transshipment_"
Expand Down

0 comments on commit ba947a6

Please sign in to comment.