Repository navigation
Fix - Saving of period partitions - #16
Merged
Merged
Conversation
* Store the mapping between receding horizon and original `PeriodPartition`s under `:partitions` * Rebuild the mapping in every horizon in the standard and the `POIExt` implementation * Extend `original` and `updated` to `PeriodPartition` Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Restrict partition index sets to the partitions fully included in the implementation horizon * Identify time period and partition index sets for both dense and sparse containers Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Move the `CapDirect` link with period partitions to `test/utils.jl` * Use `CapDirect` in the `Result containers` case and test the partition mapping and extraction * Test the extracted partition variable in the full `POIExt` run Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Added release notes entry * Described the partition mapping and result extraction in the developer notes * Added the new mapping functions to the internal library reference Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* Add horizon lengths and an optional second `CapDirect` link to `create_poi_case` * Test in `Full model run` that each link is indexed by its own original partitions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Index `:partitions` in `map_org` by the updated and in `map_updated` by the original element * Add three argument `original`/`updated` for `PeriodPartition` with fallback to two arguments * Map results row-wise in `update_results!` using the first index as element Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Identify the type of the index sets of a `SparseAxisArray` through its first key * Only collect the unique keys of index sets over period partitions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lfbernardino
approved these changes
Oct 6, 2026
lfbernardino
left a comment
Collaborator
There was a problem hiding this comment.
It looks good. The re-organization to have mapping as a separate file is welcome, as we start to have quite a few functionalities there.
Remember to update NEWS.md for merging :)
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.
As outlined in #15, variables indexed over
PeriodPartitions resulted in errors in the results saving routine as the methodoriginalwas not defined forPeriodPartition.This PR adds a mapping between the receding horizon partitions and the original partitions to the
UpdateCase. The mapping is stored per element and rebuilt in every horizon, in both the standard and thePOIExtimplementation. Results are now extracted for partitions inside the implementation horizon and are indexed by the original partitions.Requirement: a partition-indexed variable must have its element as the first index (
m[:var][x, t_pd]). This cannot be avoided.The PR was heavily created by Claude although I reviewed all changes in each individual step.
Note
I used it also to slightly restructure the file which can serve as a basis for the updating of the
UpdateCaseas outlined in #14.