Skip to content

as_forecast_sample.<package> adapters home #1138

@seabbs

Description

@seabbs

This is a discussion issue for identifying where we think package adapters to the scoringutils format should live.

The design intention here is that developers with or without our support would implement adapters for their formats into the scoringutils format and then signpost to our docs for how to work with it. This is nice as it makes there be a standard scoringutils API vs an ecosystem with potentially lots of adapters with different names, or, worse, copy and pasted code from vignettes, and a range of vignettes demonstrating scoringutils with a range of practice that may get out of date (or even worse a wrapper around score itself!)

The issue with this design is that to implement a converter package, maintainers have to depend on scoringutils (this is a hard requirement of extending a s3 method). For some packages, this isn't a huge issue as scoringutils is quite lightweight but for others I think it could be a real problem. Aside from that, there is also the perception of having an additional dependency being a problem, which we might like to avoid?

So what do we do about this?

One option is that we add converters from other package formats to scoringutils itself. Here as we are the home of the s3 generic this could be done as a suggests and so not impact our dependency tree. The downside though, is it adds code for us to support (i.e. if the package format changes the converter may break).

Another option is we spin out the s3 generic parts of the package into a lightweight package that we then depend on. This could then be a zero upstream dependency for others. However, in may cases they may want to use our tools i.e as_forecast_sample.dataframe etc which would lead back to the core package as a dependency.

A final option is we suggest maintainers make their own extension packages for scoringutils adapters if they don't want us as a dependency

I think the several packages have hit this issue i.e broom, parsnip, tidymodels etc. so understanding what they do to resolve it seems like it might be a useful path.

There are several examples of these converters in the wild:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions