Skip to content

Fix assert_forecast_type actual parameter for multivariate sample - #1130

Merged
seabbs merged 1 commit into
mainfrom
fix-assert-forecast-type-multivariate-sample
Mar 3, 2026
Merged

seabbs merged 1 commit into
mainfrom
fix-assert-forecast-type-multivariate-sample

Conversation

@nikosbosse

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes assert_forecast.forecast_multivariate_sample passing "forecast_multivariate_sample" (the full class name) instead of "multivariate_sample" (the short type name) to assert_forecast_type(actual = ...)
  • All other forecast types pass the short name (e.g. "sample", "quantile", "binary", "multivariate_point"), so this was an inconsistency introduced in Fix #1071: Rename forecast_sample_multivariate class to match constructor #1072

Bug: assert_forecast(data, forecast_type = "multivariate_sample") would error with:

Forecast type determined by scoringutils based on input: "forecast_multivariate_sample".
Desired forecast type: "multivariate_sample".

even though "multivariate_sample" is the correct type string returned by get_forecast_type().

Test plan

  • Added test that calls assert_forecast(data, forecast_type = "multivariate_sample") — fails before fix, passes after
  • Full test suite passes: 735 tests, 0 failures

🤖 Generated with Claude Code

assert_forecast.forecast_multivariate_sample was passing the full class
name "forecast_multivariate_sample" as the actual parameter to
assert_forecast_type(), instead of just "multivariate_sample" (the type
name with the "forecast_" prefix stripped). All other forecast types
pass the short name (e.g. "sample", "quantile", "binary").

This caused assert_forecast(data, forecast_type = "multivariate_sample")
to error even though "multivariate_sample" is the correct type string
returned by get_forecast_type().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nikosbosse
nikosbosse requested a review from seabbs March 1, 2026 09:37
@codecov

codecov Bot commented Mar 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.96%. Comparing base (e2b1552) to head (64b5f18).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1130   +/-   ##
=======================================
  Coverage   97.96%   97.96%           
=======================================
  Files          37       37           
  Lines        1961     1961           
=======================================
  Hits         1921     1921           
  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 seabbs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice thanks. Hmm this was flagged in review so I thought we had fixed it but clearly not.

@seabbs
seabbs merged commit 1735528 into main Mar 3, 2026
11 checks passed
@seabbs
seabbs deleted the fix-assert-forecast-type-multivariate-sample branch March 3, 2026 12:13
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.

2 participants