Skip to content

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

Merged
topepo merged 2 commits into
masterfrom
tunable
Jan 3, 2020
Merged

Register the S3 method to the class, not the full function name#439
topepo merged 2 commits into
masterfrom
tunable

Conversation

@DavisVaughan
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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