Skip to content

Commit

Permalink
changes for no-suggests
Browse files Browse the repository at this point in the history
  • Loading branch information
topepo committed Oct 15, 2024
1 parent 478a52c commit 1fbbf92
Show file tree
Hide file tree
Showing 24 changed files with 120 additions and 57 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/R-CMD-check-hard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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
#
# NOTE: This workflow only directly installs "hard" dependencies, i.e. Depends,
# Imports, and LinkingTo dependencies. Notably, Suggests dependencies are never
# installed, with the exception of testthat, knitr, and rmarkdown. The cache is
# never used to avoid accidentally restoring a cache containing a suggested
# dependency.
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check-hard.yaml

permissions: read-all

jobs:
check-no-suggests:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, r: 'release'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

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

- 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@v2
with:
dependencies: '"hard"'
cache: false
extra-packages: |
any::rcmdcheck
any::testthat
any::knitr
any::rmarkdown
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
2 changes: 1 addition & 1 deletion R/autoplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ brulee_plot <- function(object, ...) {
#' vertical line shows the epoch with the best loss value.
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "yardstick", "modeldata"))) {
#' library(ggplot2)
#' library(recipes)
#' theme_set(theme_bw())
Expand Down
2 changes: 1 addition & 1 deletion R/coef.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ brulee_coefs <- function(object, epoch = NULL, ...) {
#' a list of arrays.
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "modeldata"))) {
#'
#' data(ames, package = "modeldata")
#'
Expand Down
5 changes: 4 additions & 1 deletion R/linear_reg-fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "yardstick", "modeldata"))) {
#'
#' ## -----------------------------------------------------------------------------
#'
#' library(recipes)
#' library(yardstick)
#'
#' data(ames, package = "modeldata")
#'
#' ames$Sale_Price <- log10(ames$Sale_Price)
Expand Down
2 changes: 1 addition & 1 deletion R/linear_reg-predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed("recipes")) {
#'
#' data(ames, package = "modeldata")
#'
Expand Down
2 changes: 1 addition & 1 deletion R/logistic_reg-fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "yardstick", "modeldata"))) {
#'
#' library(recipes)
#' library(yardstick)
Expand Down
2 changes: 1 addition & 1 deletion R/logistic_reg-predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "yardstick", "modeldata")))) {
#'
#' library(recipes)
#' library(yardstick)
Expand Down
2 changes: 1 addition & 1 deletion R/mlp-fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "yardstick", "modeldata")))) {
#'
#' ## -----------------------------------------------------------------------------
#' # regression examples (increase # epochs to get better results)
Expand Down
2 changes: 1 addition & 1 deletion R/mlp-predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "modeldata")))) {
#' # regression example:
#'
#' data(ames, package = "modeldata")
Expand Down
2 changes: 1 addition & 1 deletion R/multinomial_reg-fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "yardstick", "modeldata"))) {
#'
#' library(recipes)
#' library(yardstick)
Expand Down
2 changes: 1 addition & 1 deletion R/multinomial_reg-predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#'
#' @examples
#' \donttest{
#' if (torch::torch_is_installed()) {
#' if (torch::torch_is_installed() & rlang::is_installed(c("recipes", "yardstick", "modeldata")))) {
#'
#' library(recipes)
#' library(yardstick)
Expand Down
33 changes: 15 additions & 18 deletions R/schedulers.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,25 @@
#'
#' @seealso [brulee_mlp()]
#' @examples
#' library(ggplot2)
#' library(dplyr)
#' library(purrr)
#' if (rlang::is_installed("purrr")) {
#' library(ggplot2)
#' library(dplyr)
#' library(purrr)
#'
#' iters <- 0:50
#' iters <- 0:50
#'
#' bind_rows(
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_decay_time), type = "decay_time"),
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_decay_expo), type = "decay_expo"),
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_step), type = "step"),
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_cyclic), type = "cyclic")
#' ) %>%
#' ggplot(aes(epoch, rate)) +
#' geom_line() +
#' facet_wrap(~ type)
#' bind_rows(
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_decay_time), type = "decay_time"),
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_decay_expo), type = "decay_expo"),
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_step), type = "step"),
#' tibble(epoch = iters, rate = map_dbl(iters, schedule_cyclic), type = "cyclic")
#' ) %>%
#' ggplot(aes(epoch, rate)) +
#' geom_line() +
#' facet_wrap(~ type)
#'
#' # ------------------------------------------------------------------------------
#' # Use with neural network
#' }
#'
#'


#' @export

schedule_decay_time <- function(epoch, initial = 0.1, decay = 1) {
Expand Down
2 changes: 1 addition & 1 deletion man/brulee-autoplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/brulee-coefs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/brulee_linear_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/brulee_logistic_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/brulee_mlp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/brulee_multinomial_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/predict.brulee_linear_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/predict.brulee_logistic_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/predict.brulee_mlp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/predict.brulee_multinomial_reg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 17 additions & 18 deletions man/schedule_decay_time.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tests/testthat/test-schedulers.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
library(purrr)


test_that("scheduling functions", {
skip_if_not_installed("purrr")
library(purrr)

x <- 0:100

Expand Down

0 comments on commit 1fbbf92

Please sign in to comment.