Skip to content

Conversation

@Jerry-Jinfeng-Guo
Copy link
Member

Enable exception NotObservableError from meshed observability check.

  • Exception thrown in sub check, align with radial check behavior
  • Adjust test error type accordingly

@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo self-assigned this Oct 28, 2025
@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo added the feature New feature or request label Oct 28, 2025
Copy link
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

This PR enables the NotObservableError exception to be thrown from the meshed network observability check, aligning its error handling behavior with the radial observability check.

Key changes:

  • Modified sufficient_condition_meshed_without_voltage_phasor to throw NotObservableError instead of returning false when no spanning tree can be constructed
  • Updated test expectations to verify the exception is thrown rather than checking for a false return value

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
power_grid_model_c/power_grid_model/include/power_grid_model/math_solver/observability.hpp Changed function to throw NotObservableError when spanning tree construction fails instead of returning false
tests/cpp_unit_tests/test_observability.cpp Updated test to expect NotObservableError exception instead of checking boolean return value
tests/data/state_estimation/meshed-network-observability/02-unobservable-with-branch-measurement/params.json Changed expected exception type from SparseMatrixError to NotObservableError

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo changed the title Enable error for meshed observability check Observability: enable error for meshed observability check Oct 28, 2025
mgovers
mgovers previously approved these changes Oct 28, 2025
…ath_solver/observability.hpp

Signed-off-by: Jerry Guo <[email protected]>
@sonarqubecloud
Copy link

@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo added this pull request to the merge queue Oct 28, 2025
Merged via the queue into main with commit d7b9e7f Oct 28, 2025
31 checks passed
@Jerry-Jinfeng-Guo Jerry-Jinfeng-Guo deleted the feature/enable-notobservable-error-in-se-calculations branch October 28, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants