Fix score() dropping scale for multivariate transform_forecasts#1109
Merged
seabbs-bot merged 1 commit intomainfrom Feb 16, 2026
Merged
Fix score() dropping scale for multivariate transform_forecasts#1109seabbs-bot merged 1 commit intomainfrom
seabbs-bot merged 1 commit intomainfrom
Conversation
…ransforms When transform_forecasts(append=TRUE) was used on multivariate forecasts, the .mv_group_id values were copied from the original data without recomputation. This caused score() to see scale varying within each group and drop the scale column from results. Now infers joint_across from the original forecast and recomputes .mv_group_id on the combined data so each scale gets distinct groups. Closes #1108 Co-authored-by: Sam Abbott <contact@samabbott.co.uk>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1109 +/- ##
=======================================
Coverage 97.85% 97.86%
=======================================
Files 35 35
Lines 1865 1873 +8
=======================================
+ Hits 1825 1833 +8
Misses 40 40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
score()silently dropping thescalecolumn whentransform_forecasts(append = TRUE)is used on multivariate forecasts.mv_group_idwas copied verbatim from the original data duringrbind, so both scales shared the same group IDs.get_grouping()then excludedscalebecause it varied within each group..mv_group_idafter appending by inferringjoint_acrossfrom the original forecast and callingas_forecast_multivariate_sample()on the combined dataCloses #1108
Test plan
.mv_group_idvalues are distinct across scales aftertransform_forecasts(append = TRUE)score()output containsscalecolumn with both values and correct row countThis was opened by a bot. Please ping @seabbs for any questions.