Skip to content

Add component model developer checklist#358

Open
pelesh wants to merge 3 commits intodevelopfrom
slaven/model-developer-checklist
Open

Add component model developer checklist#358
pelesh wants to merge 3 commits intodevelopfrom
slaven/model-developer-checklist

Conversation

@pelesh
Copy link
Copy Markdown
Collaborator

@pelesh pelesh commented Apr 2, 2026

Description

Add checklist for phasor dynamics component model development.

Proposed changes

Expand GridKit/Model/PhasorDynamics/README.md to include component model developer checklist.

Checklist

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

Further comments

Asking for more than usual reviews as we want to make sure the checklist is detailed and clear enough to everyone. Questions and feedback are appreciated.

@pelesh pelesh self-assigned this Apr 2, 2026
@pelesh pelesh added documentation Improvements or additions to documentation good first issue Good for newcomers question Further information is requested labels Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@Steven-Roberts Steven-Roberts left a comment

Choose a reason for hiding this comment

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

A couple minor comments, but overall looks good.

Comment on lines +51 to +58
1. Constructor tests (smoke tests).
2. Residual evaluation test (pick input variables to get easy to verify
residual values).
3. Jacobian evaluation test (Enzyme generated Jacobian must match Jacobian
created using dependency tracking variables).
4. Initialization test (initialize to arbitrary, easy to verify values).
5. Initialize and evaluate residual test (initialization should ensure
residual evaluates to zero within prescribed tolerance).
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's not entirely clear what the difference between 1 and 4 are, as well as 2 and 5.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

1 is testing constructor (instantiation), while 4 checks setting the initial value (initialization).

2 is testing residual for arbitrary values of variables, preferably those that would catch numerical errors (i.e. avoid zeros and ones for variable values). 5 is checking that residual vector is zero after initialization, i.e. verifies that the component is initialized at a steady state. Initialization usually sets many variables to zero, so 5 may not be a complete check that residual function is correctly implemented.

I will try to explain this better in the checklist.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I believe this is explained better in 6ca8a09. @Steven-Roberts, please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation good first issue Good for newcomers question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants