Skip to content

refactor(importer): remove redundant basic_node_breaker_network_powsybl code#373

Open
BenjPetr wants to merge 5 commits intomainfrom
refactor/remove_redundant_test_grids
Open

refactor(importer): remove redundant basic_node_breaker_network_powsybl code#373
BenjPetr wants to merge 5 commits intomainfrom
refactor/remove_redundant_test_grids

Conversation

@BenjPetr
Copy link
Copy Markdown
Collaborator

@BenjPetr BenjPetr commented Apr 13, 2026

Signed-off-by: Bpetrick 170433522+BenjPetr@users.noreply.github.com

Checklist

Please check if the PR fulfills these requirements:

  • PR Title follows conventional commit messages
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • All commits in this PR are DCO signed-off (see CONTRIBUTING.md)

Does this PR already have an issue describing the problem?

Fixes #

What is the new behavior (if this is a feature change)?

Does this PR introduce a breaking change?

  • Yes
  • No

removes redundant code from the test and uses the basic_node_breaker_network_powsybl() from the toop_engine_grid_helpers

…bl code

Signed-off-by: Bpetrick <170433522+BenjPetr@users.noreply.github.com>
…work_powsybl_grid

Signed-off-by: Bpetrick <170433522+BenjPetr@users.noreply.github.com>
…l() as a shared setup function, move basic_node_breaker_network_powsybl_v2 from importer tests

Signed-off-by: Bpetrick <170433522+BenjPetr@users.noreply.github.com>
…o grid helper

Signed-off-by: Bpetrick <170433522+BenjPetr@users.noreply.github.com>
@BenjPetr BenjPetr marked this pull request as ready for review April 13, 2026 11:19
@BenjPetr BenjPetr requested review from LeonHilf and Copilot April 13, 2026 11:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the importer test suite to reuse the shared Powsybl node-breaker example grids from toop_engine_grid_helpers, removing duplicated network-construction logic from importer_pkg tests.

Changes:

  • Replaced large inline Powsybl grid-building fixtures in importer_pkg tests with calls to basic_node_breaker_network_powsybl() / basic_node_breaker_network_powsybl_v2().
  • Updated multiple tests to use the new/renamed fixtures and added Network type annotations where helpful.
  • Refactored grid_helpers_pkg example grid code to extract shared node-breaker setup into a reusable helper.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/importer_pkg/tests/pypowsybl_import/test_preprocessing.py Updates fixture usage/type annotations to use the shared node-breaker grid.
packages/importer_pkg/tests/pypowsybl_import/test_powsybl_masks.py Switches tests to the shared grid fixture; minor signature adjustment.
packages/importer_pkg/tests/pypowsybl_import/merge_ucte_cgmes/test_merge_ucte_cgmes.py Updates fixture usage for node-breaker network tests.
packages/importer_pkg/tests/pypowsybl_import/cgmes/test_powsybl_masks_cgmes.py Uses shared node-breaker grid fixture and adds type annotation.
packages/importer_pkg/tests/pypowsybl_import/cgmes/test_cgmes_toolset.py Uses shared node-breaker grid fixture and adds type annotation.
packages/importer_pkg/tests/network_graph/test_powsybl_station_to_graph.py Updates tests to use the renamed/shared node-breaker fixtures.
packages/importer_pkg/tests/network_graph/test_graph_to_asset_topo.py Updates v2 tests to use the new shared v2 node-breaker fixture.
packages/importer_pkg/tests/conftest.py Removes duplicated grid construction and wires fixtures to grid_helpers_pkg example grids.
packages/grid_helpers_pkg/src/toop_engine_grid_helpers/powsybl/example_grids.py Introduces shared builder helper and adds basic_node_breaker_network_powsybl_v2() to centralize test grid creation.

Comment thread packages/importer_pkg/tests/pypowsybl_import/test_powsybl_masks.py Outdated
LeonHilf
LeonHilf previously approved these changes Apr 13, 2026
Copy link
Copy Markdown
Collaborator

@LeonHilf LeonHilf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

…work_powsybl_v2() and three_node_pst_example()

Signed-off-by: Bpetrick <170433522+BenjPetr@users.noreply.github.com>
@sonarqube-mccs
Copy link
Copy Markdown

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.

3 participants