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
Merged

Conversation

@DavisVaughan
Copy link
Contributor

@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.

@topepo topepo merged commit 80776d8 into master Jan 3, 2020
8 of 16 checks passed
8 of 16 checks passed
windows-latest (3.6)
Details
windows-latest (3.6)
Details
macOS-latest (3.6)
Details
macOS-latest (3.6)
Details
macOS-latest (devel) macOS-latest (devel)
Details
macOS-latest (devel) macOS-latest (devel)
Details
ubuntu-16.04 (3.3) ubuntu-16.04 (3.3)
Details
ubuntu-16.04 (3.3) ubuntu-16.04 (3.3)
Details
ubuntu-16.04 (3.4) ubuntu-16.04 (3.4)
Details
ubuntu-16.04 (3.4) ubuntu-16.04 (3.4)
Details
ubuntu-16.04 (3.5) ubuntu-16.04 (3.5)
Details
ubuntu-16.04 (3.5) ubuntu-16.04 (3.5)
Details
ubuntu-16.04 (3.6) ubuntu-16.04 (3.6)
Details
ubuntu-16.04 (3.6) ubuntu-16.04 (3.6)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.