epiforecasts / scoringutils

Utilities for Scoring and Assessing Predictions
https://epiforecasts.io/scoringutils/
Other
48 stars 20 forks source link

Issue #771 - Make quantile_to_interval() an internal function #794

Closed nikosbosse closed 3 months ago

nikosbosse commented 4 months ago

Description

This PR closes #771.

This PR makes quantile_to_interval() an internal function. I basically just exchanged the S3 dispatch system with an if/else statement and slightly renamed the functions (quantile_to_interval_dataframe() is missing a . because the linter will complain if the name is >30 chars). This allowed for minimal changes to the existing code and also would allow us to change it back easily if we ever decided to go back to S3.

The issue originally suggested to make quantile_to_interval() require a forecast object. I decided against that as quantile_to_interval() is now an internal function and the data.frame version is only called in one space, namely from inside the version for numeric forecasts. That function itself checks its inputs, so there is no additional benefit in converting to a forecast object first.

Checklist