Tiered charge bug fix and additions - #63
Open
dalyw wants to merge 3 commits into
Open
Conversation
- EECO's tiered-charge pricing mutates the charge arrays it is given in place, even though subsequent calculate_cost calls might use different tiers - Helpful to have warnings for charge tiers that are zeroed Warn if a tiered charge key is zeroed out due to missing consumption_estimate Add a ValueError for a consumption_estimate that isn't a scalar or has the wrong length. Only apply convex relaxation for tier with a finite next_limit or an hour-specific rate. Flat top-tiers can be represented exactly in LP. Updating comments
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
+ Coverage 95.21% 96.06% +0.84%
==========================================
Files 10 10
Lines 1861 1929 +68
==========================================
+ Hits 1772 1853 +81
+ Misses 89 76 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
utils.py - index_set, lower_bound, and initialize arguments to ut.max(), passed through to add_component() costs.py - adding get_charge_window() helper and using it in get_prev_demand_dict and calculate_demand_cost where it calls ut.max() - in calculate_demand_cost, calling ut.max() first to get the timesteps that matter for demand charges adding test casess to test_max_pyo. Adding epigraph expectation to test_calculate_cost_pyo_non_standard_index. New test_get_charge_window
… consumption estimates
dalyw
marked this pull request as ready for review
September 2, 2026 18:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
flex-pse identified EECO bugs/limitation:
Updates in costs.py:
With these changes:
utils.py
costs.py
tests
Code edits and new test cases written with prompting Claude Opus 5 then manually checked
Changes would be a minor version bump, no breaking changes
Pull request recommendations:
Thanks for contributing!