Skip to content

Fix score() dropping scale for multivariate transform_forecasts#1109

Merged
seabbs-bot merged 1 commit intomainfrom
multivariate-transform
Feb 16, 2026
Merged

Fix score() dropping scale for multivariate transform_forecasts#1109
seabbs-bot merged 1 commit intomainfrom
multivariate-transform

Conversation

@seabbs-bot
Copy link
Copy Markdown
Collaborator

Summary

  • Fixes score() silently dropping the scale column when transform_forecasts(append = TRUE) is used on multivariate forecasts
  • Root cause: .mv_group_id was copied verbatim from the original data during rbind, so both scales shared the same group IDs. get_grouping() then excluded scale because it varied within each group.
  • Fix: recompute .mv_group_id after appending by inferring joint_across from the original forecast and calling as_forecast_multivariate_sample() on the combined data

Closes #1108

Test plan

  • New test: .mv_group_id values are distinct across scales after transform_forecasts(append = TRUE)
  • New test: score() output contains scale column with both values and correct row count
  • All 695 existing tests pass
  • No lint issues on changed files

This was opened by a bot. Please ping @seabbs for any questions.

…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
Copy link
Copy Markdown

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.86%. Comparing base (4f53389) to head (f0fcade).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@seabbs-bot seabbs-bot requested a review from seabbs February 16, 2026 14:28
@seabbs-bot seabbs-bot enabled auto-merge (squash) February 16, 2026 15:16
Copy link
Copy Markdown
Contributor

@seabbs seabbs left a comment

Choose a reason for hiding this comment

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

LGTM

@seabbs-bot seabbs-bot merged commit a4face3 into main Feb 16, 2026
11 checks passed
@seabbs-bot seabbs-bot deleted the multivariate-transform branch February 16, 2026 15:23
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.

score() does not group by scale for forecast_multivariate_sample with transform_forecasts(append=TRUE)

2 participants