Allow asset selection to continue with unmet demand#1365
Open
tsmbland wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1365 +/- ##
==========================================
- Coverage 89.75% 89.74% -0.02%
==========================================
Files 58 58
Lines 8529 8530 +1
Branches 8529 8530 +1
==========================================
Hits 7655 7655
- Misses 561 562 +1
Partials 313 313 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the investment asset-selection loop so that when appraisal yields no remaining feasible options, the simulation does not abort immediately; instead it logs a warning and proceeds, allowing the subsequent full system dispatch to potentially satisfy demand with already-selected assets (as discussed in #1363 / #1363 context).
Changes:
- Replaced an early
bail!on “no feasible options left” with awarn!andbreakfrom the selection loop. - Updated logging imports to include
warn.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
869
to
870
| .iter() | ||
| .filter(|(_, flow)| **flow > Flow(0.0)) |
11 tasks
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.
Description
As discussed in #1363, it's possible that, even if asset selection runs out of options, the assets already selected may still be able to meet the full commodity demands in the context of a system dispatch with supply constraints. This at least gives it a chance to try. If it can't, you'll get the warning added here, followed by the usual message about unmet demand from the dispatch, which hopefully should be clear enough.
Fixes # (issue)
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks