refactor(importer): remove redundant basic_node_breaker_network_powsybl code#373
Open
refactor(importer): remove redundant basic_node_breaker_network_powsybl code#373
Conversation
…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>
Contributor
There was a problem hiding this comment.
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_pkgtests with calls tobasic_node_breaker_network_powsybl()/basic_node_breaker_network_powsybl_v2(). - Updated multiple tests to use the new/renamed fixtures and added
Networktype annotations where helpful. - Refactored
grid_helpers_pkgexample 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. |
…work_powsybl_v2() and three_node_pst_example() Signed-off-by: Bpetrick <170433522+BenjPetr@users.noreply.github.com>
|
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.




Signed-off-by: Bpetrick 170433522+BenjPetr@users.noreply.github.com
Checklist
Please check if the PR fulfills these requirements:
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?
removes redundant code from the test and uses the basic_node_breaker_network_powsybl() from the toop_engine_grid_helpers