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

Generalize #50

Merged
merged 34 commits into from
Feb 23, 2019
Merged

Generalize #50

merged 34 commits into from
Feb 23, 2019

Conversation

DavisVaughan
Copy link
Member

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
    • They are designed in this way so developers can branch off 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 either mold(x, data, engine = NULL) or, for the x y method mold(x, y, engine = NULL). Depending on the input, x, a default engine is selected and most of the time that engine argument won't be touched and will just be NULL.

  • If developers want to use something like intercept = TRUE or indicators = FALSE then they pass an engine to mold() directly. For instance, to use indicators = FALSE with the formula method of mold you would do mold(~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() and shrink() has been changed so that new_data is first and the engine comes second.

- 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
@DavisVaughan DavisVaughan merged commit 3ee9d6c into master Feb 23, 2019
@DavisVaughan DavisVaughan deleted the generalize branch February 23, 2019 21:27
@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 Jun 30, 2021
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.

Generalize
1 participant