Skip to content

feat: update component properties and add plugin flag for plant names use - #328

Open
mcllerena wants to merge 4 commits into
mainfrom
ml/plant-names
Open

mcllerena wants to merge 4 commits into
mainfrom
ml/plant-names

Conversation

@mcllerena

Copy link
Copy Markdown
Contributor

No description provided.

@codecov-commenter

codecov-commenter commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.45%. Comparing base (a5801e0) to head (332dbaa).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #328      +/-   ##
==========================================
+ Coverage   85.43%   85.45%   +0.02%     
==========================================
  Files          20       20              
  Lines        5594     5598       +4     
==========================================
+ Hits         4779     4784       +5     
+ Misses        815      814       -1     
Files with missing lines Coverage Δ
...enna-to-plexos/src/r2x_sienna_to_plexos/getters.py 82.94% <100.00%> (+0.07%) ⬆️
...o-plexos/src/r2x_sienna_to_plexos/plugin_config.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical x/r mappings and moderate tail-membership handling block approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates translation rules for revised Sienna component properties and adds configurable plant-unit naming.

Changes:

  • Adds use_plant_unit_names configuration and generator naming behavior.
  • Updates component fixtures and tests.
  • Aligns ReEDS and PLEXOS↔Sienna mappings with revised fields.
File summaries
File Summary
packages/r2x-sienna-to-plexos/tests/test_translation_rule_application.py Updates reservoir construction tests.
packages/r2x-sienna-to-plexos/tests/test_getters.py Updates component fixtures for revised fields.
packages/r2x-sienna-to-plexos/tests/test_getters_system.py Updates turbine construction tests.
packages/r2x-sienna-to-plexos/tests/test_getters_membership.py Updates reservoir and turbine membership fixtures.
packages/r2x-sienna-to-plexos/tests/test_getters_helpers.py Updates reservoir test data.
packages/r2x-sienna-to-plexos/tests/test_getters_generators.py Adds configurable naming behavior tests.
packages/r2x-sienna-to-plexos/src/r2x_sienna_to_plexos/plugin_config.py Adds naming configuration.
packages/r2x-sienna-to-plexos/src/r2x_sienna_to_plexos/getters.py Applies configurable generator names.
packages/r2x-reeds-to-sienna/tests/test_translation_rule_application.py Validates category-based reservoir sides.
packages/r2x-reeds-to-sienna/src/r2x_reeds_to_sienna/config/rules.json Moderate finding (1 vote): Update membership handling for the new category/upstream-turbine representation or retain compatible metadata.
packages/r2x-plexos-to-sienna/src/r2x_plexos_to_sienna/config/rules.json Critical finding (2 votes): Add direct x/r mappings or getters so source values are preserved.
Review details

Suppressed comments (1)

packages/r2x-reeds-to-sienna/src/r2x_reeds_to_sienna/config/rules.json:426

  • This removes the side marker that the Sienna-to-PLEXOS membership pass still uses for tail links. The emitted tail reservoir is linked through upstream_turbines, but ensure_tail_storage_generator_membership only checks downstream_turbines and otherwise inspects turbine.reservoirs[].reservoir_location; with this rule no reservoir_location is present, so the explicit tail association is skipped and the later name-based synthesis can attach the wrong storage when names differ. Update that membership logic to use the new category/upstream_turbines representation (or retain compatible metadata).
      "level_data_type": "ENERGY"
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +28 to +31
use_plant_unit_names: bool = Field(
default=True,
description="Use plant and unit names from generator metadata instead of Sienna names.",
)

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.

Can we discuss this? Cc @akrivi @jarry7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, please can we discuss further.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants