diff --git a/DESCRIPTION b/DESCRIPTION index a4c9e49d..ca5beed2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Type: Package Package: paradox Title: Define and Work with Parameter Spaces for Complex Algorithms -Version: 0.7.1.9000 +Version: 0.8.0 Authors@R: c(person(given = "Michel", family = "Lang", @@ -57,7 +57,7 @@ Config/testthat/edition: 3 Config/testthat/parallel: false NeedsCompilation: no Roxygen: list(markdown = TRUE, r6 = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2 Collate: 'Condition.R' 'Design.R' diff --git a/NEWS.md b/NEWS.md index 3b844e1b..c667bd18 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,9 @@ # paradox 0.7.1.9000 -- Same as previous version. +* Parameters now have a new (optional) field `description`. +* Improved printing of parameters in documentation (#355). +* A warning is now signaled if the package `ParamHelpers` is also loaded. +* Fixed some links. # paradox 0.7.1 diff --git a/R/ParamSet.R b/R/ParamSet.R index 6a2d3ae5..103efceb 100644 --- a/R/ParamSet.R +++ b/R/ParamSet.R @@ -619,7 +619,6 @@ ParamSet = R6Class("ParamSet", idmapping = map(partsets, function(x) x$ids()) pars = ps_union(partsets) pars$set_id = self$set_id - parsnames = names(pars$params) # only add the dependencies that are also in the tuning PS on = id = NULL # pacify static code check pmap(self$deps[id %in% names(idmapping) & on %in% names(partsets), c("on", "id", "cond")], function(on, id, cond) { @@ -683,6 +682,7 @@ rd_info.ParamSet = function(ps, descriptions = character(), ...) { # nolint if (length(descriptions)) { params = merge(params, enframe(descriptions, name = "id", value = "description"), all.x = TRUE, by = "id") + description = NULL params[is.na(description), description := ""] setcolorder(params, c("id", "description")) } diff --git a/R/ParamSetCollection.R b/R/ParamSetCollection.R index ee7aef2a..7dd7567e 100644 --- a/R/ParamSetCollection.R +++ b/R/ParamSetCollection.R @@ -60,9 +60,7 @@ ParamSetCollection = R6Class("ParamSetCollection", inherit = ParamSet, add = function(p) { assert_r6(p, "ParamSet") setnames = map_chr(private$.sets, "set_id") - if (p$set_id == "") { - unnamed_set_parnames = map(private$.sets[setnames == ""], function(x) names(x$params_unid)) - } else if (p$set_id %in% setnames) { + if (p$set_id != "" && p$set_id %in% setnames) { stopf("Setid '%s' already present in collection!", p$set_id) } if (p$has_trafo) { diff --git a/man/paradox-package.Rd b/man/paradox-package.Rd index 3cbae10c..7e7ef662 100644 --- a/man/paradox-package.Rd +++ b/man/paradox-package.Rd @@ -4,13 +4,9 @@ \name{paradox-package} \alias{paradox} \alias{paradox-package} -\title{paradox: Define and Work with Parameter Spaces for Complex - Algorithms} +\title{paradox: Define and Work with Parameter Spaces for Complex Algorithms} \description{ -Define parameter spaces, constraints and - dependencies for arbitrary algorithms, to program on such spaces. Also - includes statistical designs and random samplers. Objects are - implemented as 'R6' classes. +Define parameter spaces, constraints and dependencies for arbitrary algorithms, to program on such spaces. Also includes statistical designs and random samplers. Objects are implemented as 'R6' classes. } \seealso{ Useful links: