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
[x] My PR is based on a package issue and I have explicitly linked it.
[x] I have included the target issue or issues in the PR title as follows: issue-number: PR title
[x] I have tested my changes locally.
[x] I have added or updated unit tests where necessary.
[x] I have updated the documentation if required.
[x] I have built the package locally and run rebuilt docs using roxygen2.
[x] My code follows the established coding standards and I have run lintr::lint_package() to check for style issues introduced by my changes.
[ ] I have added a news item linked to this PR.
[ ] I have reviewed CI checks for this PR and addressed them as far as I am able.
Description
This PR closes #771.
This PR makes
quantile_to_interval()
an internal function. I basically just exchanged the S3 dispatch system with anif
/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 asquantile_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
lintr::lint_package()
to check for style issues introduced by my changes.