[BUG] `aggregate_components` silently drops components with NaN in a grouping column
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
Research direction
Read edisgo/edisgo.py around line 1885 and the named regression test, tests/properties/test_properties_edisgo.py::TestDataHandling::test_aggregate_components_keeps_loads_with_missing_sector. Check how component and time series grouping handle missing keys, then run the regression test. Done means loads with a NaN sector remain in the aggregated data and the test passes with power flow v_res and i_res unchanged.
Written by the indexing model from the issue text.
Description
Summary
EDisGo.aggregate_components groups components with groupby(...).sum(), which drops groups with NaN keys (dropna=True). A load with sector = NaN and aggregate_loads_by_cols=["bus", "sector"] disappears from loads_df: p_set at the bus drops from 0.945 to 0.635 MW in test grid 1. The time series aggregation then iterates over groupby.groups, which still contains the NaN group, and raises TypeError.
Where
edisgo/edisgo.py:1885 aggregate_components.
How to reproduce
Test (strict xfail, added in #856): tests/properties/test_properties_edisgo.py::TestDataHandling::test_aggregate_components_keeps_loads_with_missing_sector
Passing: aggregate_components keeps v_res and i_res of the power flow unchanged.
Proposed fix
Use groupby(..., dropna=False) (and the same for the time series), or fill NaN in the grouping columns with a placeholder before grouping.
Related
#728 (load_aggregation_mode="bus" erases type).
- Dominant language
- Python
- Stars
- 48
- Forks
- 22
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 38
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openego/eDisGo
-
area: database bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[BUG] Spatial complexity reduction merges MV and LV buses when an LV grid has the ID of the MV gridOpenbug correctness priority: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
bug correctness priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
area: opf documentation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area: opf housekeeping priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gke-labs/kube-agents#5671 ·
Maintainers usually reply within 1 day
-
docs(auth): Method B step 4 should tell users to tick "Use this client for an AI-powered agent"Opendocumentation next-release v0.9.6
Difficulty 1/5 Under an hour Newbie friendliness 88/100
khuisman/mcp-gee-sweet#1446 ·
Maintainers usually reply within 1 day
-
model:sonnet runtime:claude security size:S
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
FootprintAI/Containarium#3671 ·
Maintainers usually reply within 1 day
-
HolidayBase: reassigning `language` does not re-initialize translations or re-populate holidaysPossibly taken @shikhabhadoria claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vacanza/holidays#4116 · 1 comment ·
Maintainers usually reply within 1 day
-
bug CLI exec
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day