tidymodels / dials

Tools for creating tuning parameter values
https://dials.tidymodels.org/
Other
111 stars 26 forks source link

revise `parameters.default` error message to point out class of `x` #225

Closed simonpcouch closed 2 years ago

simonpcouch commented 2 years ago

The current source for parameters.default is:

https://github.com/tidymodels/dials/blob/252f8f61476815c1f2b33965f0f300d68de722cf/R/parameters.R#L14-L16

Would you be open to a PR that revises the error message here to include mention of class(x)[1]? Maybe something like:

Error:
! `parameters` objects cannot be created from objects of class `tune_results`.

I'm currently debugging some internals of stacks where the call to parameters() is pretty deep in the call stack, and imagine that some other common usages of parameters() may not be user-facing—some mention of what was being passed to where may have saved a round or two of debugonce(...)/options(error = recover). :)

hfrick commented 2 years ago

that sounds like a good idea 👍

github-actions[bot] commented 2 years ago

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.