feat: add new types of loads for reeds to plexos translations#256
feat: add new types of loads for reeds to plexos translations#256mcllerena wants to merge 16 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for translating new ReEDS demand component types (electrolyzer + data center) into PLEXOS Purchasers, including purchaser/node memberships and time series transfer.
Changes:
- Add rules mapping
ReEDSElectrolyzerDemandandReEDSDataCenterDemandtoPLEXOSPurchaserand add purchaser→node membership creation. - Add purchaser time series transfer step to the ReEDS→PLEXOS translation flow.
- Update tests to cover rule presence and translation behavior for the new demand types.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Adds new dependencies and switches several uv sources to editable path-based deps. |
| packages/r2x-reeds-to-plexos/tests/test_translation_rule_application.py | Adds end-to-end translation assertions for electrolyzer/data-center demands. |
| packages/r2x-reeds-to-plexos/tests/test_rule_loading.py | Adds tests ensuring new mapping rules exist in rules.json. |
| packages/r2x-reeds-to-plexos/tests/test_getters_utils.py | Adds unit test for attaching time series to purchasers. |
| packages/r2x-reeds-to-plexos/src/r2x_reeds_to_plexos/translation.py | Runs purchaser time-series attachment during translation. |
| packages/r2x-reeds-to-plexos/src/r2x_reeds_to_plexos/getters_utils.py | Implements attach_time_series_to_purchasers. |
| packages/r2x-reeds-to-plexos/src/r2x_reeds_to_plexos/getters.py | Expands lookup to include new demand components for memberships. |
| packages/r2x-reeds-to-plexos/src/r2x_reeds_to_plexos/config/rules.json | Adds new purchaser rules + purchaser node membership; adjusts consuming-tech rule filtering. |
| packages/r2x-reeds-to-plexos/src/r2x_reeds_to_plexos/config/defaults.json | Adds an electrolyzer defaults block. |
| packages/r2x-reeds-to-plexos/src/r2x_reeds_to_plexos/init.py | Exports attach_time_series_to_purchasers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Marck Llerena V. <140716266+mcllerena@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #256 +/- ##
==========================================
+ Coverage 84.95% 84.99% +0.03%
==========================================
Files 19 19
Lines 4561 4584 +23
==========================================
+ Hits 3875 3896 +21
- Misses 686 688 +2
🚀 New features to boost your workflow:
|
pesap
left a comment
There was a problem hiding this comment.
Requesting changes for the dependency contract issue noted inline.
| "units": "get_component_units" | ||
| }, | ||
| "source_type": "ReEDSElectrolyzerDemand", | ||
| "target_type": "PLEXOSPurchaser", |
There was a problem hiding this comment.
One blocker: the package metadata still allows dependency versions that do not provide the new model classes used by these rules.
Evidence:
packages/r2x-reeds-to-plexos/pyproject.tomlallowsr2x-reeds>=0.4.0,<1.0.0andr2x-plexos>=0.1.4,<1.0.0.- The new rules reference
ReEDSElectrolyzerDemand,ReEDSDataCenterDemand, andPLEXOSPurchaser. r2x-reeds==0.4.0does not expose the new ReEDS demand classes, andr2x-plexos==0.1.4does not exposePLEXOSPurchaser.
Can you either bump the minimum dependency versions to released versions that contain those classes, or make the new rules conditional on class availability? Otherwise valid installs under the declared package contract can fail the new translation path.
|
|
||
| # Test node getters | ||
| assert getters.get_node_number(node, context).unwrap() == 123 | ||
| assert getters.get_node_number(node, context).unwrap() == 1230 |
There was a problem hiding this comment.
This assertion appears to encode test-order dependence. get_node_number("p123") earlier in the module reserves 123 in global state, so NODE_123 becomes 1230 only because a previous test ran first. Please reset the global numbering state between tests or move numbering state into the translation context, then keep NODE_123 deterministic.
No description provided.