Summary
transform_forecasts() currently handles all forecast types through a single function with internal branching (e.g. checking for .mv_group_id to detect multivariate forecasts). As more special cases arise (like the fix in #1108 for multivariate group ID recomputation), this approach becomes harder to maintain and extend.
Proposal
Make transform_forecasts() an S3 generic with methods dispatching on the forecast class. This would allow each forecast type to handle its own transform logic cleanly, for example:
transform_forecasts.forecast_multivariate_sample() could handle .mv_group_id recomputation natively
transform_forecasts.forecast_quantile() (and others) could use the current default logic
- New forecast types could define their own transform behaviour without modifying the core function
Motivation
This was opened by a bot. Please ping @seabbs for any questions.
Summary
transform_forecasts()currently handles all forecast types through a single function with internal branching (e.g. checking for.mv_group_idto detect multivariate forecasts). As more special cases arise (like the fix in #1108 for multivariate group ID recomputation), this approach becomes harder to maintain and extend.Proposal
Make
transform_forecasts()an S3 generic with methods dispatching on the forecast class. This would allow each forecast type to handle its own transform logic cleanly, for example:transform_forecasts.forecast_multivariate_sample()could handle.mv_group_idrecomputation nativelytransform_forecasts.forecast_quantile()(and others) could use the current default logicMotivation
rbind(score() does not group by scale for forecast_multivariate_sample with transform_forecasts(append=TRUE) #1108)score(),as_forecast_*())This was opened by a bot. Please ping @seabbs for any questions.