Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add can_retire validation for multi-stage optimization #683

Merged
merged 7 commits into from
Apr 19, 2024

Conversation

lbonaldo
Copy link
Collaborator

@lbonaldo lbonaldo commented Apr 15, 2024

Description

The current implementation of multi-stage optimization doesn't allow a resource to switch from can_retire = 0 to can_retire = 1 between stages. This PR adds a validation check on the can_retire flag and throws an error if necessary.

What type of PR is this? (check all applicable)

  • Feature

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and .md files under /docs/src have been updated if necessary.
  • The latest changes on the target branch have been incorporated, so that any conflicts are taken care of before merging. This can be accomplished either by merging in the target branch (e.g. 'git merge develop') or by rebasing on top of the target branch (e.g. 'git rebase develop'). Please do not hesitate to reach out to the GenX development team if you need help with this.
  • Code has been tested to ensure all functionality works as intended.
  • CHANGELOG.md has been updated (if this is a 'notable' change).
  • I consent to the release of this PR's code under the GNU General Public license.

How this can be tested

By running the multi-stage example with can_retire = 0 for some resources in stage = 1, and then switching to can_retire = 1 in stage = 2.

Post-approval checklist for GenX core developers

After the PR is approved

  • Check that the latest changes on the target branch are incorporated, either via merge or rebase
  • Remember to squash and merge if incorporating into develop

@lbonaldo lbonaldo requested a review from sambuddhac April 15, 2024 18:42
src/case_runners/case_runner.jl Outdated Show resolved Hide resolved
test/test_multistage.jl Outdated Show resolved Hide resolved
test/test_multistage.jl Outdated Show resolved Hide resolved
lbonaldo and others added 3 commits April 15, 2024 14:48
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
test/test_multistage.jl Outdated Show resolved Hide resolved
test/test_multistage.jl Outdated Show resolved Hide resolved
test/test_multistage.jl Outdated Show resolved Hide resolved
Copy link
Collaborator

@sambuddhac sambuddhac left a comment

Choose a reason for hiding this comment

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

So, we for sure don't want the "can retire" to flip values between stages? Any rationale in support of that?

@lbonaldo
Copy link
Collaborator Author

The current multi-stage implementation utilizes the RET_CAP set to create variables for keeping track of retired capacity across all stages. If there is a change in this set between two stages, this function will throw an exception if a key is not found between the current and previous stages.

lbonaldo and others added 2 commits April 19, 2024 11:31
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@lbonaldo lbonaldo merged commit 1102d32 into release/0.4.0 Apr 19, 2024
7 checks passed
@lbonaldo lbonaldo deleted the warn_retire_ms branch April 19, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants