Skip to content

Commit

Permalink
Stop incrementing next_etrago_id results
Browse files Browse the repository at this point in the history
Since the IDs are randomly generated now, there's no reason to increment
them anymore. Both variants are (roughly) equally likely to collide with
IDs already in use.
  • Loading branch information
gnn committed Sep 7, 2022
1 parent 81bca5f commit 91af5d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/egon/data/datasets/electrical_neighbours.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def buses(scenario, sources, targets):

central_buses = central_buses_egon100(sources)

next_bus_id = db.next_etrago_id("bus") + 1
next_bus_id = db.next_etrago_id("bus")

# if in test mode, add bus in center of Germany
if config.settings()["egon-data"]["--dataset-boundary"] != "Everything":
Expand Down Expand Up @@ -620,7 +620,7 @@ def foreign_dc_lines(scenario, sources, targets, central_buses):
pd.DataFrame(
index=[1],
data={
"link_id": db.next_etrago_id("link") + 1,
"link_id": db.next_etrago_id("link"),
"bus0": converter_bentwisch,
"bus1": central_buses[
(central_buses.country == "DK")
Expand Down

0 comments on commit 91af5d2

Please sign in to comment.