-
Notifications
You must be signed in to change notification settings - Fork 17
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
Generalize #50
Merged
Merged
Generalize #50
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Use zeallot - Use refresh_engine() with update_engine()
- Fix shrink() documentation and uses - Fix scream() documentation and uses
…e collected before adding an intercept column
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #39
The concept of a preprocessing "engine" has been formalized and supersedes the "preprocessor+engine" combination that we had previously.
Engines are created in a hierarchy. There is a base engine created from
new_engine()
and the all the other engines inherit from that.There are 3 types of engines included with hardhat:
new_engine
->new_xy_engine
->new_default_xy_engine
new_engine
->new_formula_engine
->new_default_formula_engine
new_engine
->new_recipe_engine
->new_default_recipe_engine
new_formula_engine
and create their own formula preprocessing engine, and not be locked into the specific stuff we do in the default formula engine.Engines are somewhat complex objects that would only ever be created by the most determined developers who really want to implement a custom preprocessing engine. They are very standardized, so all input and output is consistent across the board. For full info on what an engine is, see my brain dump in
?new_engine
.mold()
has been simplified greatly. The only arguments are eithermold(x, data, engine = NULL)
or, for the x y methodmold(x, y, engine = NULL)
. Depending on the input,x
, a default engine is selected and most of the time thatengine
argument won't be touched and will just beNULL
.If developers want to use something like
intercept = TRUE
orindicators = FALSE
then they pass an engine tomold()
directly. For instance, to useindicators = FALSE
with the formula method of mold you would domold(~Species, iris, default_formula_engine(indicators = FALSE))
. This is pretty clean, and importantly means that the engine specific arguments are now controlled by the engine directly, not by mold.The order of args to
forge()
scream()
andshrink()
has been changed so thatnew_data
is first and theengine
comes second.