Skip to content

Consider making transform_forecasts() an S3 generic #1110

@seabbs-bot

Description

@seabbs-bot

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions