Skip to content

Commit

Permalink
Merge pull request #769 from openego/fixes/#768-two-DE-buses-when-usi…
Browse files Browse the repository at this point in the history
…ng-ehv_clustering-and-market-optimization

Fixes #768 fix positions of foreign clustered buses in market_model
  • Loading branch information
CarlosEpia authored Dec 13, 2024
2 parents a6a3005 + ba947a6 commit d79eea9
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 d79eea9

Please sign in to comment.