Skip to content

Add group tag#255

Open
paulf81 wants to merge 3 commits intoNatLabRockies:developfrom
paulf81:feature/group_tag
Open

Add group tag#255
paulf81 wants to merge 3 commits intoNatLabRockies:developfrom
paulf81:feature/group_tag

Conversation

@paulf81
Copy link
Copy Markdown
Collaborator

@paulf81 paulf81 commented Apr 30, 2026

This PR does two things that shouldn't change Hercules behavior

  1. Adds a new YAML key: component_group to the list of component_name, component_type and component_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 then component_group = component_name. Docs are updated and tests of new behavior included.

  2. 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_group key.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_group handling to ComponentBase (default + type validation + write-back into h_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_analysis and how component_group is 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.

@misi9170
Copy link
Copy Markdown
Collaborator

#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 component_group tag, or would that change what is possible with a multiunit plant? Alternatively, should we simply create a generic multiunit component type to replace your component_group, and assign all grouped components to the same higher-level multiunit component (something we talked about when implementing #224)? This would mean that, say, we could have a single top-level solar component with multiple different lower level solar units, in a hierarchy.

@paulf81
Copy link
Copy Markdown
Collaborator Author

paulf81 commented Apr 30, 2026

#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 component_group tag, or would that change what is possible with a multiunit plant? Alternatively, should we simply create a generic multiunit component type to replace your component_group, and assign all grouped components to the same higher-level multiunit component (something we talked about when implementing #224)? This would mean that, say, we could have a single top-level solar component with multiple different lower level solar units, in a hierarchy.

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.

@paulf81 paulf81 added on-hold work on pause and removed Ready for review labels Apr 30, 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 on-hold work on pause

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants