`network.merge(...)` seems to add default values for outputs
@lkstrp is already working on this.
Since Mar 18, 2026.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 699
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 13
Description
Version Checks (indicate both or one)
-
I have confirmed this bug exists on the lastest release of PyPSA.
-
I have confirmed this bug exists on the current
masterbranch of PyPSA.
Issue Description
Not 100% on this one.
Calling n_merged = n.merge(n_other) seems to restore some values to their default values, even if they were not present in either network.
In my case, n and n_other had both <n|n_other.>c.links.dynamic["p0"].empty == True.
However then n_mergedc.links.dynamic["p0"].empty == False, with all valeus set to 0.
This is not bad per-se. The problem is in combination with other functionality that determines if a network has already been solved or not and behaves differently depending on which attributes are set / not set.
In my case that is the network.cluster.temporal.segmentation(...) function that throws a warning as it encounters values in p1 and others:
Reproducible Example
-
Expected Behavior
n.merge(...) should not re-add attributes with their default values if they were not present in the originating networks.
Installed Versions
Contributor 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.
Assessment
This issue has not been assessed yet.