Repository navigation
fix/bridge detection for parallel branches - #145
Open
JoostvanDijkTenneT wants to merge 6 commits into
Open
JoostvanDijkTenneT wants to merge 6 commits into
JoostvanDijkTenneT wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The obsolete sparse import and number_edges assignment trigger Ruff F401/F841 violations in CI pre-commit checks and must be removed.
1 open issue
What changed in this PR
This PR corrects bridge detection during network preprocessing so parallel branches are not incorrectly treated as individual bridges.
Changes:
- Uses a NetworkX
MultiGraphto preserve parallel edges. - Adds a regression test for two parallel branches.
- Cleans up LODF tests and relaxes the voltage-angle comparison tolerance.
| File | Description |
|---|---|
tests/preprocess/test_helper_functions.py |
Adds regression coverage for parallel branches. |
tests/numpy/test_lodf.py |
Removes unused variables, corrects spelling, and adjusts angle tolerance. |
src/dc_plus/preprocess/helper_functions.py |
Replaces sparse-matrix graph construction with a multigraph. |
Review effort: Balanced
Signed-off-by: Dijk <Joost.van.Dijk@tennet.eu>
Signed-off-by: Dijk <Joost.van.Dijk@tennet.eu>
…some computers). Signed-off-by: Dijk <Joost.van.Dijk@tennet.eu>
Signed-off-by: Dijk <Joost.van.Dijk@tennet.eu>
Signed-off-by: Dijk <Joost.van.Dijk@tennet.eu>
Signed-off-by: Dijk <Joost.van.Dijk@tennet.eu>
JoostvanDijkTenneT
force-pushed
the
fix/bug-bridge-detection
branch
from
November 4, 2026 15:23
2f9329b to
a99aa9f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Checklist
Please check if the PR fulfills these requirements:
Does this PR already have an issue describing the problem?
No.
Fixes
Parallel branches which would cause two connected components when removed from the graph are now marked as a bridge. This PR fixes that.
Does this PR introduce a breaking change?