diff --git a/DESCRIPTION b/DESCRIPTION index 2d3168f8..c93bd081 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dials Title: Tools for Creating Tuning Parameter Values -Version: 1.2.1.9000 +Version: 1.3.0 Authors@R: c( person("Max", "Kuhn", , "max@posit.co", role = "aut"), person("Hannah", "Frick", , "hannah@posit.co", role = c("aut", "cre")), diff --git a/NAMESPACE b/NAMESPACE index 89cfddeb..a6cf4ca2 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -14,19 +14,15 @@ S3method(finalize,parameters) S3method(grid_latin_hypercube,list) S3method(grid_latin_hypercube,param) S3method(grid_latin_hypercube,parameters) -S3method(grid_latin_hypercube,workflow) S3method(grid_max_entropy,list) S3method(grid_max_entropy,param) S3method(grid_max_entropy,parameters) -S3method(grid_max_entropy,workflow) S3method(grid_random,list) S3method(grid_random,param) S3method(grid_random,parameters) -S3method(grid_random,workflow) S3method(grid_regular,list) S3method(grid_regular,param) S3method(grid_regular,parameters) -S3method(grid_regular,workflow) S3method(grid_space_filling,list) S3method(grid_space_filling,param) S3method(grid_space_filling,parameters) @@ -142,7 +138,6 @@ export(prior_terminal_node_expo) export(prod_degree) export(prune) export(prune_method) -export(pull_dials_object) export(range_get) export(range_set) export(range_validate) diff --git a/NEWS.md b/NEWS.md index 00eb1558..5bc35c25 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# dials (development version) +# dials 1.3.0 ## Improvements @@ -6,9 +6,17 @@ * A new function is used to access all of the space-filling designs called `grid_space_filling()` (#329). +* Two new parameters, `activation_2()` and `hidden_units_2()`, for use with `brulee::brulee_mlp_two_layer()` (#339). + +## Deprecations + * `grid_max_entropy()` and `grid_latin_hypercube()` are deprecated in favor of `grid_space_filling()` (#332). -* Two new parameters, `activation_2()` and `hidden_units_2()`, for use with `brulee::brulee_mlp_two_layer()` (#339). +* `pull_dials_object()` has been removed (#344). + +* The `grid_*()` methods for `workflow` objects have been removed (#344). + +* The deprecation of the `default` argument to the constructors `new_quant_param()` and `new_qual_param()` has been escalated to an error (#344). # dials 1.2.1 diff --git a/R/constructors.R b/R/constructors.R index 0b931553..1c8d4a18 100644 --- a/R/constructors.R +++ b/R/constructors.R @@ -87,7 +87,7 @@ new_quant_param <- function(type = c("double", "integer"), ..., call = caller_env()) { if (lifecycle::is_present(default)) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( when = "1.1.0", what = "new_quant_param(default)" ) @@ -184,7 +184,10 @@ new_qual_param <- function(type = c("character", "logical"), ..., call = caller_env()) { if (lifecycle::is_present(default)) { - lifecycle::deprecate_warn(when = "1.1.0", what = "new_qual_param(default)") + lifecycle::deprecate_stop( + when = "1.1.0", + what = "new_qual_param(default)" + ) } type <- arg_match0(type, values = c("character", "logical")) diff --git a/R/grids.R b/R/grids.R index a8dd8aa7..e2e89d56 100644 --- a/R/grids.R +++ b/R/grids.R @@ -116,20 +116,6 @@ grid_regular.param <- function(x, grd } -#' @export -#' @rdname grid_regular -grid_regular.workflow <- function(x, - ..., - levels = 3, - original = TRUE, - filter = NULL) { - lifecycle::deprecate_stop( - when = "1.2.0", - what = "grid_regular.workflow()", - details = "Alternatively, first extract the parameter set with `extract_parameter_set_dials()`, then create the grid from that object." - ) -} - make_regular_grid <- function(..., levels = 3, original = TRUE, @@ -241,18 +227,6 @@ grid_random.param <- function(x, ..., size = 5, original = TRUE, filter = NULL) grd } - -#' @export -#' @rdname grid_regular -grid_random.workflow <- function(x, ..., size = 5, original = TRUE, filter = NULL) { - lifecycle::deprecate_stop( - when = "1.2.0", - what = "grid_random.workflow()", - details = "Alternatively, first extract the parameter set with `extract_parameter_set_dials()`, then create the grid from that object." - ) -} - - make_random_grid <- function(..., size = 5, original = TRUE, diff --git a/R/pull_dials_object.R b/R/pull_dials_object.R deleted file mode 100644 index db07deff..00000000 --- a/R/pull_dials_object.R +++ /dev/null @@ -1,30 +0,0 @@ -#' Return a dials parameter object associated with parameters -#' -#' @description -#' `r lifecycle::badge("deprecated")` -#' -#' This function has been deprecated; please use -#' `hardhat::extract_parameter_dials()` instead. -#' -#' `pull_dials_object()` can extract a single `dials` parameter object from -#' different types of objects (e.g. parameter sets, recipes, etc.). -#' @param x The results of a call to [parameters()], a recipe, model -#' specification, or workflow. -#' @param id A single string for the `id` of the parameter. -#' @param ... Not currently used. -#' @return A `dials` parameter object. -#' @keywords internal -#' @examples -#' glmn_param <- parameters(lambda = penalty(), mixture()) -#' # pull_dials_object(glmn_param, "lambda") -#' # -> -#' extract_parameter_dials(glmn_param, "lambda") -#' @export -pull_dials_object <- function(x, id, ...) { - lifecycle::deprecate_stop( - "0.1.0", - "pull_dials_object()", - "hardhat::extract_parameter_dials()" - ) - UseMethod("pull_dials_object") -} diff --git a/R/space_filling.R b/R/space_filling.R index 3b82e3f4..79c46e0a 100644 --- a/R/space_filling.R +++ b/R/space_filling.R @@ -275,7 +275,7 @@ grid_max_entropy <- function(x, variogram_range = 0.5, iter = 1000) { lifecycle::deprecate_soft( - "1.2.1.9000", + "1.3.0", "grid_max_entropy()", "grid_space_filling()" ) @@ -358,24 +358,6 @@ grid_max_entropy.param <- function(x, new_param_grid(grd) } -#' @export -#' @rdname grid_max_entropy -grid_max_entropy.workflow <- function(x, - ..., - size = 3, - original = TRUE, - variogram_range = 0.5, - iter = 1000) { - - lifecycle::deprecate_stop( - when = "1.2.0", - what = "grid_max_entropy.workflow()", - details = "Alternatively, first extract the parameter set with `extract_parameter_set_dials()`, then create the grid from that object." - ) -} - - - make_max_entropy_grid <- function(..., size = 3, original = TRUE, @@ -420,7 +402,7 @@ make_max_entropy_grid <- function(..., #' @rdname grid_max_entropy grid_latin_hypercube <- function(x, ..., size = 3, original = TRUE) { lifecycle::deprecate_soft( - "1.2.1.9000", + "1.3.0", "grid_latin_hypercube()", "grid_space_filling()" ) @@ -466,19 +448,6 @@ grid_latin_hypercube.param <- function(x, ..., size = 3, original = TRUE) { new_param_grid(grd) } - -#' @export -#' @rdname grid_max_entropy -grid_latin_hypercube.workflow <- function(x, ..., size = 3, original = TRUE) { - lifecycle::deprecate_stop( - when = "1.2.0", - what = "grid_latin_hypercube.workflow()", - details = "Alternatively, first extract the parameter set with `extract_parameter_set_dials()`, then create the grid from that object." - ) -} - - - make_latin_hypercube_grid <- function(..., size = 3, original = TRUE, call = caller_env()) { validate_params(..., call = call) param_quos <- quos(...) diff --git a/README.Rmd b/README.Rmd index a69a8702..2d512d72 100644 --- a/README.Rmd +++ b/README.Rmd @@ -52,7 +52,7 @@ pak::pak("tidymodels/dials") Please note that the dials project is released with a [Contributor Code of Conduct](https://dials.tidymodels.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. -- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on RStudio Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question). +- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on Posit Community](https://forum.posit.co/new-topic?category_id=15&tags=tidymodels,question). - If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/dials/issues). diff --git a/README.md b/README.md index 80af88a5..17deb733 100644 --- a/README.md +++ b/README.md @@ -49,8 +49,8 @@ of Conduct](https://dials.tidymodels.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms. - For questions and discussions about tidymodels packages, modeling, and - machine learning, please [post on RStudio - Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question). + machine learning, please [post on Posit + Community](https://forum.posit.co/new-topic?category_id=15&tags=tidymodels,question). - If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/dials/issues). diff --git a/cran-comments.md b/cran-comments.md index f6d17c66..e69de29b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1 +0,0 @@ -This release contains the requested fix to the documentation of `encode_unit()`, for R-devel. diff --git a/man/grid_max_entropy.Rd b/man/grid_max_entropy.Rd index 3ad892c8..82f88d1d 100644 --- a/man/grid_max_entropy.Rd +++ b/man/grid_max_entropy.Rd @@ -5,12 +5,10 @@ \alias{grid_max_entropy.parameters} \alias{grid_max_entropy.list} \alias{grid_max_entropy.param} -\alias{grid_max_entropy.workflow} \alias{grid_latin_hypercube} \alias{grid_latin_hypercube.parameters} \alias{grid_latin_hypercube.list} \alias{grid_latin_hypercube.param} -\alias{grid_latin_hypercube.workflow} \title{Max-entropy and latin hypercube grids} \usage{ grid_max_entropy( @@ -49,15 +47,6 @@ grid_max_entropy( iter = 1000 ) -\method{grid_max_entropy}{workflow}( - x, - ..., - size = 3, - original = TRUE, - variogram_range = 0.5, - iter = 1000 -) - grid_latin_hypercube(x, ..., size = 3, original = TRUE) \method{grid_latin_hypercube}{parameters}(x, ..., size = 3, original = TRUE) @@ -65,8 +54,6 @@ grid_latin_hypercube(x, ..., size = 3, original = TRUE) \method{grid_latin_hypercube}{list}(x, ..., size = 3, original = TRUE) \method{grid_latin_hypercube}{param}(x, ..., size = 3, original = TRUE) - -\method{grid_latin_hypercube}{workflow}(x, ..., size = 3, original = TRUE) } \arguments{ \item{x}{A \code{param} object, list, or \code{parameters}.} diff --git a/man/grid_regular.Rd b/man/grid_regular.Rd index c04aceba..c33aa93f 100644 --- a/man/grid_regular.Rd +++ b/man/grid_regular.Rd @@ -5,12 +5,10 @@ \alias{grid_regular.parameters} \alias{grid_regular.list} \alias{grid_regular.param} -\alias{grid_regular.workflow} \alias{grid_random} \alias{grid_random.parameters} \alias{grid_random.list} \alias{grid_random.param} -\alias{grid_random.workflow} \title{Create grids of tuning parameters} \usage{ grid_regular(x, ..., levels = 3, original = TRUE, filter = NULL) @@ -21,8 +19,6 @@ grid_regular(x, ..., levels = 3, original = TRUE, filter = NULL) \method{grid_regular}{param}(x, ..., levels = 3, original = TRUE, filter = NULL) -\method{grid_regular}{workflow}(x, ..., levels = 3, original = TRUE, filter = NULL) - grid_random(x, ..., size = 5, original = TRUE, filter = NULL) \method{grid_random}{parameters}(x, ..., size = 5, original = TRUE, filter = NULL) @@ -30,8 +26,6 @@ grid_random(x, ..., size = 5, original = TRUE, filter = NULL) \method{grid_random}{list}(x, ..., size = 5, original = TRUE, filter = NULL) \method{grid_random}{param}(x, ..., size = 5, original = TRUE, filter = NULL) - -\method{grid_random}{workflow}(x, ..., size = 5, original = TRUE, filter = NULL) } \arguments{ \item{x}{A \code{param} object, list, or \code{parameters}.} diff --git a/man/pull_dials_object.Rd b/man/pull_dials_object.Rd deleted file mode 100644 index 444974f5..00000000 --- a/man/pull_dials_object.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pull_dials_object.R -\name{pull_dials_object} -\alias{pull_dials_object} -\title{Return a dials parameter object associated with parameters} -\usage{ -pull_dials_object(x, id, ...) -} -\arguments{ -\item{x}{The results of a call to \code{\link[=parameters]{parameters()}}, a recipe, model -specification, or workflow.} - -\item{id}{A single string for the \code{id} of the parameter.} - -\item{...}{Not currently used.} -} -\value{ -A \code{dials} parameter object. -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} - -This function has been deprecated; please use -\code{hardhat::extract_parameter_dials()} instead. - -\code{pull_dials_object()} can extract a single \code{dials} parameter object from -different types of objects (e.g. parameter sets, recipes, etc.). -} -\examples{ -glmn_param <- parameters(lambda = penalty(), mixture()) -# pull_dials_object(glmn_param, "lambda") -# -> -extract_parameter_dials(glmn_param, "lambda") -} -\keyword{internal} diff --git a/revdep/cran.md b/revdep/cran.md index 82823a64..995d3044 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 24 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. +We checked 30 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/tests/testthat/_snaps/constructors.md b/tests/testthat/_snaps/constructors.md index 426bde64..0537486f 100644 --- a/tests/testthat/_snaps/constructors.md +++ b/tests/testthat/_snaps/constructors.md @@ -286,8 +286,8 @@ quant_param <- new_quant_param(type = "integer", default = 5L, values = 1:10, label = c(foo = "Foo")) Condition - Warning: - The `default` argument of `new_quant_param()` is deprecated as of dials 1.1.0. + Error: + ! The `default` argument of `new_quant_param()` was deprecated in dials 1.1.0 and is now defunct. --- @@ -295,6 +295,6 @@ qual_param <- new_qual_param(type = "logical", values = c(FALSE, TRUE), default = TRUE, label = c(foo = "Foo")) Condition - Warning: - The `default` argument of `new_qual_param()` is deprecated as of dials 1.1.0. + Error: + ! The `default` argument of `new_qual_param()` was deprecated in dials 1.1.0 and is now defunct. diff --git a/tests/testthat/_snaps/pull_dials_object.md b/tests/testthat/_snaps/pull_dials_object.md deleted file mode 100644 index 3c1864e6..00000000 --- a/tests/testthat/_snaps/pull_dials_object.md +++ /dev/null @@ -1,9 +0,0 @@ -# pull_dials_object is deprecated - - Code - pull_dials_object(mod_param, "mixture") - Condition - Error: - ! `pull_dials_object()` was deprecated in dials 0.1.0 and is now defunct. - i Please use `hardhat::extract_parameter_dials()` instead. - diff --git a/tests/testthat/_snaps/space_filling.md b/tests/testthat/_snaps/space_filling.md index 00c407b7..68ebf2f9 100644 --- a/tests/testthat/_snaps/space_filling.md +++ b/tests/testthat/_snaps/space_filling.md @@ -4,7 +4,7 @@ grid_max_entropy(mixture(), trees(), size = 2) Condition Warning: - `grid_max_entropy()` was deprecated in dials 1.2.1.9000. + `grid_max_entropy()` was deprecated in dials 1.3.0. i Please use `grid_space_filling()` instead. Output # A tibble: 2 x 2 @@ -28,7 +28,7 @@ grid_latin_hypercube(mixture(), trees(), size = 2) Condition Warning: - `grid_latin_hypercube()` was deprecated in dials 1.2.1.9000. + `grid_latin_hypercube()` was deprecated in dials 1.3.0. i Please use `grid_space_filling()` instead. Output # A tibble: 2 x 2 diff --git a/tests/testthat/test-constructors.R b/tests/testthat/test-constructors.R index 728b92a2..c330962a 100644 --- a/tests/testthat/test-constructors.R +++ b/tests/testthat/test-constructors.R @@ -194,7 +194,7 @@ test_that("`values` is validated", { test_that("`default` arg is deprecated", { - expect_snapshot({ + expect_snapshot(error = TRUE, { quant_param <- new_quant_param( type = "integer", default = 5L, @@ -202,9 +202,7 @@ test_that("`default` arg is deprecated", { label = c(foo = "Foo") ) }) - expect_null(quant_param$default) - - expect_snapshot({ + expect_snapshot(error = TRUE, { qual_param <- new_qual_param( type = "logical", values = c(FALSE, TRUE), @@ -212,5 +210,4 @@ test_that("`default` arg is deprecated", { label = c(foo = "Foo") ) }) - expect_null(qual_param$default) }) diff --git a/tests/testthat/test-pull_dials_object.R b/tests/testthat/test-pull_dials_object.R deleted file mode 100644 index 3072b15e..00000000 --- a/tests/testthat/test-pull_dials_object.R +++ /dev/null @@ -1,6 +0,0 @@ - -test_that("pull_dials_object is deprecated", { - mod_param <- parameters(list("lambda" = penalty(), mixture(range = c(0.05, 1)))) - expect_snapshot(error = TRUE, pull_dials_object(mod_param, "mixture")) -}) -