Repository navigation
Fix get_all_periods for RepresentativePeriods and OperationalScenarios - #57
Merged
Merged
Conversation
Member
Author
|
One think I forgot to mention in the description above: I did not increase the version number, as I have a pretty much finished PR for #55 which will be registered together with this PR. |
dqpinel
reviewed
Oct 7, 2026
dqpinel
approved these changes
Oct 7, 2026
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.
Problem
get_all_periods!called itself on the raw inner time structures (ts.operational,ts.rep_periods,ts.scenarios). This meant:TwoLevel. For a top-levelRepresentativePeriodsorOperationalScenarios, they were missing from the period mapping.Solution
The function now takes two arguments: the current period and the time structure it belongs to.
It walks down through the period objects (
strategic_periods,repr_periods,opscenarios), and the time structure argument decides which method runs. At theSimpleTimeslevel it collects the operational periods, so each one keeps its full index chain. New tests intest/test_utils.jlcover all combinations ofTwoLevel,RepresentativePeriods,OperationalScenariosandSimpleTimes.