Skip to content

Reject duplicate PhasorDynamics IDs and report unknown signal IDs - #645

Draft
nkoukpaizan wants to merge 1 commit into
nicholson/hierarchical-two-areafrom
nicholson/verify-ids
Draft

nkoukpaizan wants to merge 1 commit into
nicholson/hierarchical-two-areafrom
nicholson/verify-ids

Conversation

@nkoukpaizan

@nkoukpaizan nkoukpaizan commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This validates IDs in PhasorDynamics models.

Proposed changes

  • Added SystemModel::verify() that reports every repeated bus number, signal ID, device ID per class, and subsystem ID. The top system walks its tree once, so subsystems don't repeat the check.
  • Updated INPUT_FORMAT.md accordingly.

Checklist

  • All tests pass.
  • Code compiles cleanly with flags -Wall -Wpedantic -Wconversion -Wextra.
  • The new code follows GridKit™ style guidelines.
  • There are unit tests for the new code.
  • The new code is documented.
  • The feature branch is rebased with respect to the target branch.
  • The CHANGELOG.md has been updated to reflect the changes. If this is a minor PR that is part of a larger fix already included in the file, state so.

Further comments

The checks live in verify() rather than in separate per-level checks, so one call reports all problems together. They use temporary std::sets, one insert per ID, so the cost is $N \times log N$ in the number of IDs. Validating per subsystem would scale as $N \times S \times log(N/S)$.

Draft until we merge #644, and I'll change the base to develop.

@nkoukpaizan nkoukpaizan self-assigned this Nov 4, 2026
@nkoukpaizan nkoukpaizan added the enhancement New feature or request label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant