Repository navigation
Conversation
Collaborator
|
I think this needs more discussion. I am setting this to draft until we decide how to proceed. Having said that, this PR is very helpful and a good suggestion. More discussion in #482 is needed. |
lukelowry
force-pushed
the
lukel/model-schema-dev
branch
from
October 13, 2026 22:04
807fc28 to
3b32152
Compare
Collaborator
|
based on my current read of this, i think that it duplicates too much from |
lukelowry
force-pushed
the
lukel/model-schema-dev
branch
from
October 14, 2026 22:24
3b32152 to
6e6824b
Compare
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.
Description
Adds
ComponentDefinition, which gives each model one place to describe its parameters, ports and monitorable variables: units, a symbol and a short description for each.Closes #482. I originally proposed a schema or a manifest. This is the API version of that, and anyone who wants a JSON schema can generate one from it.
Proposed changes
ComponentDefinition<...>inComponentDefinition.hpp. One entry per enum value for eachComponentDataenum.complete()checks at compile time that every value is present and described.IEEET1_DEFINITIONinIeeet1Data.hppwithstatic_assert(IEEET1_DEFINITION.complete()). The old enum comments moved into it.COMPONENT_DEFINITIONSandforEachComponentDefinition(visit)inComponentLibrary.hpp. Registering a model is one line.Utilities::enum_name, anenum_namethat is safe on empty enums, behindname()on each entry.For example, listing every model and its parameters:
This gives some flexibility on consumer end which I would prefer.
Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
Consumer applications really need this otherwise a priori information is required to develop with GridKit.
@pelesh Feedback on scope/size of PR is appreciated