Skip to content

Commit

Permalink
provisional fix
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosEpia committed Oct 29, 2023
1 parent 3565f27 commit 1990353
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/egon/data/datasets/pypsaeursec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ def neighbor_reduction():
)
neighbor_gens.index += db.next_etrago_id("generator")

neighbor_gens.rename(columns={"name": "Generator"}, inplace=True)
for i in neighbor_gens_t.columns:
new_index = neighbor_gens[neighbor_gens["Generator"] == i].index
neighbor_gens_t.rename(columns={i: new_index[0]}, inplace=True)
Expand All @@ -518,7 +519,7 @@ def neighbor_reduction():
neighbors.loc[neighbor_loads.bus, "new_index"].reset_index().new_index
)
neighbor_loads.index += db.next_etrago_id("load")

neighbor_loads.rename(columns={"index": "Load"}, inplace=True)
for i in neighbor_loads_t.columns:
new_index = neighbor_loads[neighbor_loads["Load"] == i].index
neighbor_loads_t.rename(columns={i: new_index[0]}, inplace=True)
Expand All @@ -535,7 +536,7 @@ def neighbor_reduction():
neighbors.loc[neighbor_stores.bus, "new_index"].reset_index().new_index
)
neighbor_stores.index += db.next_etrago_id("store")

neighbor_stores.rename(columns={"name": "Store"}, inplace=True)
for i in neighbor_stores_t.columns:
new_index = neighbor_stores[neighbor_stores["Store"] == i].index
neighbor_stores_t.rename(columns={i: new_index[0]}, inplace=True)
Expand All @@ -558,7 +559,7 @@ def neighbor_reduction():
.new_index
)
neighbor_storage.index += db.next_etrago_id("storage")

neighbor_storage.rename(columns={"name": "StorageUnit"}, inplace=True)
for i in neighbor_storage_t.columns:
new_index = neighbor_storage[
neighbor_storage["StorageUnit"] == i
Expand Down Expand Up @@ -598,7 +599,7 @@ def neighbor_reduction():
"generator",
"location",
"sub_network",
"unit",
#"unit",
]:
neighbors = neighbors.drop(i, axis=1)

Expand Down

0 comments on commit 1990353

Please sign in to comment.