Repository navigation
Add operational_type for identifying the operational time structure of a TimeStructurePeriod - #106
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
trulsf
reviewed
Oct 22, 2026
|
|
||
| The method is implemented for [`AbstractStrategicPeriod`](@ref), | ||
| [`AbstractRepresentativePeriod`](@ref), and [`AbstractOperationalScenario`](@ref). For nested | ||
| periods (*e.g.*, a representative period of a strategic period), the type of the innermost |
Member
There was a problem hiding this comment.
It can be unclear what is meant by innermost here. E.g the innermost of the two, or the innermost operational time structure overall.
Collaborator
Author
There was a problem hiding this comment.
Yeah, I agree. It is from Claude ;) I will improve on it.
trulsf
approved these changes
Oct 22, 2026
trulsf
left a comment
Member
There was a problem hiding this comment.
Looks fine to me. I agree with keeping this at the level of returning the type. Should be enough to cover dispatch needs.
Collaborator
Author
|
I will merge once the CI ran through. From my end, we can then create a new release. |
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.
Adds the exported function
operational_type(ts::TimeStructurePeriod), which returns the type of the operational time structure held by a strategic period, representative period, or operational scenario. It complementshas_opscenariosandhas_repr_periods(#105).StrategicPeriod,StratNode,RepresentativePeriod,OperationalScenario, and theSingle*wrappers) return the type of that structure.StratReprPeriod,StratReprOpScenario) call the function on the period they contain, so they return the innermost operational structure.MethodError), as they include several operational time structures.I did not include this method for any other subtype of
TimeStructureas there is no benefit in that:TimePerioddoes not contain an operational time structure,TimeStructInnerIterandTimeStructOuterItermay contain multiple operational structures.Important
I do not return the instance, only the type. The reason for that is to avoid that people iterate over the operational time structure as that may lead to indexing problems. It hence still closes #81 as it is my opinion the better and safer approach.