Skip to content

Fix assert_forecast_type actual parameter for multivariate sample#1130

Open
nikosbosse wants to merge 1 commit intomainfrom
fix-assert-forecast-type-multivariate-sample
Open

Fix assert_forecast_type actual parameter for multivariate sample#1130
nikosbosse wants to merge 1 commit intomainfrom
fix-assert-forecast-type-multivariate-sample

Conversation

@nikosbosse
Copy link
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
Copy link

codecov bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.96%. Comparing base (e2b1552) to head (64b5f18).

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.

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.

1 participant