Skip to content

Replaced stale charging_park_id with the drawn_charging_park_id in th… - #723

Open
jldonner wants to merge 1 commit into
devfrom
679-bug-distribute_private_charging_demand
Open

jldonner wants to merge 1 commit into
devfrom
679-bug-distribute_private_charging_demand

Conversation

@jldonner

Copy link
Copy Markdown
Collaborator

Description

Used the correct variable

drawn_charging_park_id 

in the home branch's capacity bookkeeping:

designated_charging_point_capacity_df.at[  
    drawn_charging_park_id, "designated_charging_point_capacity"  
] += charging_capacity

Fixes #679

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • New and adjusted code is formatted using the pre-commit hooks
  • New and adjusted code includes type hinting now
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The Read the Docs documentation is compiling correctly
  • If new packages are needed, I added them the setup.py, and if needed the rtd_requirements.txt, the eDisGo_env.yml and the eDisGo_env_dev.yml.
  • I have added new features to the corresponding whatsnew file

…e home branch of distribute_private_charging_demand().
@joda9

joda9 commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

@jldonner fix is right. The stale id always belongs to a work park, so the increment
lands outside the slice combine_weights reads for the home parks — the capacity column
stays all zero and the feedback term degenerates into a constant. Assignment of home
cars changes measurably once there is contention between parks.

Two things before merge:

The NOTE above the loop and the inline comment above the fixed line both still say the
stale id is intentional and point at #679. Please drop them, they now describe the
opposite of what the code does.

whatsnew entry, and a regression test. Note test_distribute_charging_demand cannot
catch this — it checks totals per park, and those were always right because
designated_charging_point_capacity is regrouped from charging_processes_df. Something
like patching combine_weights and asserting the second car sees a nonzero entry at the
first car's park would hit the actual mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] distribute_private_charging_demand: home branch books capacity to a stale charging_park_id

2 participants