Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register the S3 method to the class, not the full function name #439

Merged
merged 2 commits into from
Jan 3, 2020

Conversation

DavisVaughan
Copy link
Member

@DavisVaughan DavisVaughan commented Jan 3, 2020

Closes tidymodels/tune#146

I made a typo 😭. We will need a minor recipes release for tune.

When you register a method with s3_register(), you supply it in the form:

s3_register("tune::tunable", "step_knnimpute", tunable.step_knnimpute)

I was accidentally doing:

s3_register("tune::tunable", "tunable.step_knnimpute", tunable.step_knnimpute)

It only fails in R devel because we currently explicitly export the tunable methods anyways, so they are "found" in the package environment during S3 lookup. This is what was changed in R devel, as noted by the NEWS entry: "S3 method lookup now by default skips the elements of the search path between the global and base environments." (i.e. any package env).

I think this change in S3 method lookup is good motivation to not explicitly export the tunable methods anyways, so we might consider also not exporting them.

@github-actions
Copy link

This pull request 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.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2021
@hfrick hfrick deleted the tunable branch September 17, 2021 14:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tunable methods from recipes not found
2 participants