Add group tag#255
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an optional component_group metadata tag for plant components (defaulting to component_name) so downstream tooling (notably herc_analysis) can aggregate related components without affecting Hercules simulation behavior.
Changes:
- Add
component_grouphandling toComponentBase(default + type validation + write-back intoh_dict). - Add unit tests covering defaulting, explicit values, and type errors for
component_group. - Update docs + example YAML and add a new docs page describing
herc_analysisand howcomponent_groupis intended to be used.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
hercules/plant_components/component_base.py |
Implements component_group defaulting/validation and persists it into h_dict. |
tests/component_base_test.py |
Adds tests validating component_group default behavior, explicit override, and type enforcement. |
examples/hercules_input_example.yaml |
Documents how to specify component_group in an example component block. |
docs/hybrid_plant.md |
Updates the conceptual link text to include component_group. |
docs/hercules_input.md |
Documents component_group as an optional per-component YAML key with default behavior. |
docs/herc_analysis.md |
Adds a new companion-tool doc page and explains component_group purpose. |
docs/h_dict.md |
Notes that component_group may be present and is defaulted during component construction. |
docs/component_types.md |
Extends the naming/type/category doc to include component_group and summarizes it in the table. |
docs/adding_components.md |
Updates the super().__init__() behavior list to include component_group. |
docs/_toc.yml |
Adds a “Post-Processing” section and links the new herc_analysis doc page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
#224 introduced "grouped" generating units by actually making them subsets of a component. This seems to be rather similar functionality. Could the multiunit plants introduced in #224 instead be flattened and just share a |
This is a good point. Noting you and I discussed this some IRL and going to put here I'm going to put this PR on hold, maybe permanently, in favor of a longer term plan something more like you propose here. |
This PR does two things that shouldn't change Hercules behavior
Adds a new YAML key:
component_groupto the list ofcomponent_name,component_typeandcomponent_category. Hercules itself won't use this group but it can be helpful to herc_analysis to flag that say several solar components are actually blocks of one solar farm. If no group is specified thencomponent_group=component_name. Docs are updated and tests of new behavior included.Since this change is done to benefit herc_analysis, a new doc page describing herc_analysis is included to mention and link to it. This can then explain the purpose of the new
component_groupkey.