Skip to content

Commit

Permalink
Merge pull request #81 from tidymodels/print_step
Browse files Browse the repository at this point in the history
Use print_step instead of printer
  • Loading branch information
EmilHvitfeldt authored Feb 26, 2022
2 parents 9342fc4 + 408dfa0 commit 8698526
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 43 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2

- name: Show testthat output
if: always()
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
# Add Config/Needs/website: tidyverse/tidytemplate to DESCRIPTION
on:
push:
branches: [main, master]
tags: ['*']
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: pkgdown
extra-packages: any::pkgdown, local::.
needs: website

- name: Install package
run: R CMD INSTALL .

- name: Build site
if: github.event_name == 'pull_request'
run: |
Rscript -e 'pkgdown::build_site()'
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy package
if: github.event_name == 'push'
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
4 changes: 2 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr

Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ importFrom(recipes,bake)
importFrom(recipes,check_type)
importFrom(recipes,is_trained)
importFrom(recipes,prep)
importFrom(recipes,printer)
importFrom(recipes,print_step)
importFrom(recipes,rand_id)
importFrom(recipes,recipes_eval_select)
importFrom(recipes,sel2char)
Expand Down
2 changes: 1 addition & 1 deletion R/0_imports.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#' @importFrom generics tidy
#' @importFrom purrr map_dfr map_lgl
#' @importFrom recipes add_step bake check_type is_trained prep
#' @importFrom recipes printer rand_id sel2char step recipes_eval_select
#' @importFrom recipes print_step rand_id sel2char step recipes_eval_select
#' @importFrom rlang := enquos
#' @importFrom ROSE ROSE
#' @importFrom tibble as_tibble tibble
Expand Down
4 changes: 2 additions & 2 deletions R/step_adasyn.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ bake.step_adasyn <- function(object, new_data, ...) {
#' @export
print.step_adasyn <-
function(x, width = max(20, options()$width - 26), ...) {
cat("adasyn based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "adasyn based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down
4 changes: 2 additions & 2 deletions R/step_bsmote.R
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ bake.step_bsmote <- function(object, new_data, ...) {
#' @export
print.step_bsmote <-
function(x, width = max(20, options()$width - 26), ...) {
cat("BorderlineSMOTE based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "BorderlineSMOTE based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down
4 changes: 2 additions & 2 deletions R/step_downsample.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ bake.step_downsample <- function(object, new_data, ...) {

print.step_downsample <-
function(x, width = max(20, options()$width - 26), ...) {
cat("Down-sampling based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "Down-sampling based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down
4 changes: 2 additions & 2 deletions R/step_nearmiss.R
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ bake.step_nearmiss <- function(object, new_data, ...) {
#' @export
print.step_nearmiss <-
function(x, width = max(20, options()$width - 26), ...) {
cat("NEARMISS-1 based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "NEARMISS-1 based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down
4 changes: 2 additions & 2 deletions R/step_rose.R
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ bake.step_rose <- function(object, new_data, ...) {
#' @export
print.step_rose <-
function(x, width = max(20, options()$width - 26), ...) {
cat("ROSE based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "ROSE based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down
4 changes: 2 additions & 2 deletions R/step_smote.R
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ bake.step_smote <- function(object, new_data, ...) {
#' @export
print.step_smote <-
function(x, width = max(20, options()$width - 26), ...) {
cat("SMOTE based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "SMOTE based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down
4 changes: 2 additions & 2 deletions R/step_tomek.R
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ bake.step_tomek <- function(object, new_data, ...) {
#' @export
print.step_tomek <-
function(x, width = max(20, options()$width - 26), ...) {
cat("Tomek based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "Tomek based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down
4 changes: 2 additions & 2 deletions R/step_upsample.R
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ bake.step_upsample <- function(object, new_data, ...) {

print.step_upsample <-
function(x, width = max(20, options()$width - 26), ...) {
cat("Up-sampling based on ", sep = "")
printer(x$column, x$terms, x$trained, width = width)
title <- "Up-sampling based on "
print_step(x$column, x$terms, x$trained, title, width)
invisible(x)
}

Expand Down

0 comments on commit 8698526

Please sign in to comment.