Skip to content

Initial lambda extraction - #566

Merged
pelesh merged 11 commits into
developfrom
lukel/lambda-dev
Oct 14, 2026
Merged

pelesh merged 11 commits into
developfrom
lukel/lambda-dev

Conversation

@lukelowry

@lukelowry lukelowry commented Sep 2, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Replace the per-model parameter-parsing and configuration-check lambdas with extracted helpers.

Proposed changes

  • Model::ConfigurationChecks: verify() returns every configuration problem as a message, prefixed with the model name, instead of an error count. Applied to all components.
  • Model::ParameterReader: loadReal, loadNonNegative, loadBool, loadInteger, requireReal, requireBool. Invalid model data throws std::invalid_argument naming the model and parameter.
  • Testing::configurationRejected for tests that expect rejection at construction or by verify().
  • ESDC1A migrated to ParameterReader.

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.

Further comments

None.

@nkoukpaizan nkoukpaizan added the enhancement New feature or request label Sep 3, 2026
@lukelowry
lukelowry force-pushed the lukel/lambda-dev branch 3 times, most recently from 8523e16 to 1c5cb77 Compare September 9, 2026 20:19
@lukelowry
lukelowry marked this pull request as ready for review September 10, 2026 00:11
@lukelowry

Copy link
Copy Markdown
Collaborator Author

I am marking this as ready for review, so that we can determine remaining priorities before release.

Let me know if this is worth it before release

@nkoukpaizan nkoukpaizan left a comment

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.

I like the idea of extracting the lambda. What we need to discuss is where the extracted methods will live.

Comment thread GridKit/Model/PhasorDynamics/BusFault/BusFault.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/ComponentSignals.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/ComponentSignals.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/ConfigurationChecks.hpp Outdated
Comment thread GridKit/Model/ParameterReader.hpp

@superwhiskers superwhiskers left a comment

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.

some quick comments. overall seems like a good change to make

Comment thread GridKit/Utilities/ParameterReader.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/ConfigurationChecks.hpp Outdated
@lukelowry
lukelowry force-pushed the lukel/lambda-dev branch 3 times, most recently from 10d8a1a to 11adb87 Compare September 15, 2026 20:36
@lukelowry

Copy link
Copy Markdown
Collaborator Author

I have not addressed every review comment but I have made larger cleanup and improvement, I think it's in the right direction.

@pelesh pelesh added this to the Release 0.3 milestone Sep 17, 2026
@lukelowry
lukelowry force-pushed the lukel/lambda-dev branch 4 times, most recently from cde1e6a to 6970b6d Compare September 22, 2026 03:46
Comment thread GridKit/Model/ParameterReader.hpp Outdated
Comment thread GridKit/Model/ParameterReader.hpp Outdated
Comment thread tests/UnitTests/PhasorDynamics/GovernorHygovTests.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/Controller/REPCA/RepcaImpl.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/Exciter/IEEET1/Ieeet1Impl.hpp Outdated
Comment thread GridKit/Model/PhasorDynamics/SystemModelImpl.hpp Outdated
Comment thread GridKit/Model/ConfigurationChecks.hpp
@lukelowry
lukelowry force-pushed the lukel/lambda-dev branch 4 times, most recently from 72a0648 to 6fb3a2d Compare October 10, 2026 21:02
@lukelowry

Copy link
Copy Markdown
Collaborator Author

@superwhiskers @nkoukpaizan I applied all suggested changes and also shrunk size of the PR, so its more reviewable. I only migrated ESDC1A fully and the remaining components can be migrated in a follow up.

@lukelowry lukelowry mentioned this pull request Oct 11, 2026
6 tasks done
Comment thread GridKit/Model/PhasorDynamics/Component.hpp
Comment thread GridKit/Model/ParameterReader.hpp Outdated
Comment thread GridKit/Testing/Testing.hpp Outdated
Comment thread tests/UnitTests/PhasorDynamics/BusSignalVoltageInTests.hpp Outdated
@lukelowry

Copy link
Copy Markdown
Collaborator Author

@superwhiskers rebased and all suggestions applied!

@superwhiskers superwhiskers left a comment

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.

all tests pass on my machine. should be good to merge

@pelesh pelesh left a comment

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.

Looks good.

Introducing default for verify() method in the base class will allow developers to implement component models without verify(). Do we want to nudge every component model developer to add verification checks? Are there components where there is nothing to verify?

Comment thread GridKit/Model/PhasorDynamics/Component.hpp Outdated
@lukelowry

Copy link
Copy Markdown
Collaborator Author

@pelesh Ready!!

@lukelowry

Copy link
Copy Markdown
Collaborator Author

And rebased

@pelesh
pelesh merged commit 637fe5f into develop Oct 14, 2026
6 checks passed
@lukelowry
lukelowry deleted the lukel/lambda-dev branch October 14, 2026 21:57
@lukelowry
lukelowry restored the lukel/lambda-dev branch October 14, 2026 22:03
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.

4 participants