Update dependencies and fix breakages from pyomo 6.10#280
Update dependencies and fix breakages from pyomo 6.10#280ParticularlyPythonicBS wants to merge 2 commits intounstablefrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (14)
WalkthroughReplaced Pyomo's Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5baa092 to
1383bd3
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
temoa/components/capacity.py (1)
652-654:⚠️ Potential issue | 🟡 MinorInconsistent API:
sparse_iterkeys()not updated tosparse_keys().This line still uses the deprecated
sparse_iterkeys()while all other occurrences in this file and across the PR have been updated tosparse_keys(). This should be updated for consistency with the Pyomo 6.10 migration.Proposed fix
- for r, _e, t, v in model.emission_end_of_life.sparse_iterkeys(): + for r, _e, t, v in model.emission_end_of_life.sparse_keys():🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@temoa/components/capacity.py` around lines 652 - 654, The loop uses the deprecated iterator method model.emission_end_of_life.sparse_iterkeys(); replace this call with the updated API model.emission_end_of_life.sparse_keys() in the for loop that checks (r, t, v) in model.retirement_periods and updates model.used_techs.add(t) so the code consistently uses Pyomo 6.10's sparse_keys() method.temoa/components/technology.py (1)
448-456:⚠️ Potential issue | 🟡 MinorInconsistent API:
sparse_iterkeys()not updated tosparse_keys().This line still uses the deprecated
sparse_iterkeys()while all other occurrences in this file and across the PR have been updated tosparse_keys(). This should be updated for consistency with the Pyomo 6.10 migration.Proposed fix
- for r, t, v in model.existing_capacity.sparse_iterkeys(): + for r, t, v in model.existing_capacity.sparse_keys():🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@temoa/components/technology.py` around lines 448 - 456, The loop uses the deprecated model.existing_capacity.sparse_iterkeys() API; update it to model.existing_capacity.sparse_keys() in the loop that unpacks (r, t, v) and computes cap using value(model.existing_capacity[r, t, v]) so behavior is unchanged. Locate the for-loop referencing sparse_iterkeys() in the technology component (around the block that logs non-positive existing capacity) and replace sparse_iterkeys() with sparse_keys() while keeping the unpacking and subsequent logic (variables r, t, v, cap, logger.warning, continue) intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@temoa/components/technology.py`:
- Around line 63-64: There are duplicate loops iterating
model.existing_capacity.sparse_keys() and setting
model.is_survival_curve_process[r, t, v] = False twice; remove the redundant
loop so each (r, t, v) is initialized only once (keep a single loop that
iterates model.existing_capacity.sparse_keys() and assigns
model.is_survival_curve_process[r, t, v] = False). Apply the same removal for
the other duplicated occurrences noted (the similar duplicate around the indices
handling), ensuring only one initialization loop exists for
model.is_survival_curve_process per key source.
---
Outside diff comments:
In `@temoa/components/capacity.py`:
- Around line 652-654: The loop uses the deprecated iterator method
model.emission_end_of_life.sparse_iterkeys(); replace this call with the updated
API model.emission_end_of_life.sparse_keys() in the for loop that checks (r, t,
v) in model.retirement_periods and updates model.used_techs.add(t) so the code
consistently uses Pyomo 6.10's sparse_keys() method.
In `@temoa/components/technology.py`:
- Around line 448-456: The loop uses the deprecated
model.existing_capacity.sparse_iterkeys() API; update it to
model.existing_capacity.sparse_keys() in the loop that unpacks (r, t, v) and
computes cap using value(model.existing_capacity[r, t, v]) so behavior is
unchanged. Locate the for-loop referencing sparse_iterkeys() in the technology
component (around the block that logs non-positive existing capacity) and
replace sparse_iterkeys() with sparse_keys() while keeping the unpacking and
subsequent logic (variables r, t, v, cap, logger.warning, continue) intact.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: cdbcb44b-f44d-4d8f-b92a-2da475908247
⛔ Files ignored due to path filters (2)
stubs/pyomo/core/base/param.pyiis excluded by!stubs/**uv.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
temoa/_internal/table_data_puller.pytemoa/components/capacity.pytemoa/components/commodities.pytemoa/components/costs.pytemoa/components/emissions.pytemoa/components/geography.pytemoa/components/limits.pytemoa/components/reserves.pytemoa/components/technology.pytemoa/components/time.pytemoa/model_checking/network_model_data.pytemoa/model_checking/pricing_check.pytemoa/model_checking/validators.pytests/test_full_runs.py
d4cb818 to
49e0a79
Compare
49e0a79 to
38fa269
Compare
sparse_iterkeys()withsparse_keys()to comply with pyomo 6.10 deprecationsparse_keys()calls inset()intemoa/components/technology.pyto ensure a stable lookupsSummary by CodeRabbit
Improvements
Bug Fixes
Tests