From b1eb7f6ec1d0711d1cd341d22498dbde4758545b Mon Sep 17 00:00:00 2001 From: Lorenzo Gaborini Date: Fri, 6 Jun 2025 17:41:51 +0200 Subject: [PATCH 1/3] Fix issue #206 --- R/dials-params.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/dials-params.R b/R/dials-params.R index dc39702..3a1b155 100644 --- a/R/dials-params.R +++ b/R/dials-params.R @@ -32,7 +32,7 @@ linkage_method <- function(values = values_linkage_method) { dials::new_qual_param( type = "character", values = values, - label = c(activation = "Linkage Method"), + label = c(linkage_method = "Linkage Method"), finalize = NULL ) } From 30df3545db7e16a9f5baa3d2eeb4b2a241c2b9e9 Mon Sep 17 00:00:00 2001 From: Lorenzo Gaborini Date: Tue, 10 Jun 2025 23:24:51 +0200 Subject: [PATCH 2/3] add test on parameters' names --- tests/testthat/test-hier_clust-stats.R | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/testthat/test-hier_clust-stats.R b/tests/testthat/test-hier_clust-stats.R index 70f92c0..a8aea5b 100644 --- a/tests/testthat/test-hier_clust-stats.R +++ b/tests/testthat/test-hier_clust-stats.R @@ -90,3 +90,18 @@ test_that("extract_cluster_assignment() works", { expected ) }) + +test_that("all parameters are correctly named", { + # fixes issue #206 + + param_grid <- dials::parameters( + dials::num_clusters(range = c(2, 3)), + linkage_method(), + cut_height(range = c(0, 3)) + ) + + expect_setequal( + param_grid$name, + c("num_clusters", "linkage_method", "cut_height") + ) +}) From 9f80e08e1d42d1f76926750f36b2e1aaad4574eb Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Tue, 10 Jun 2025 17:43:27 -0700 Subject: [PATCH 3/3] add news --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index b02a7a8..e96984a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,7 @@ # tidyclust (development version) +* Fixed bug when trying to tune the `linkage_method` argument. (#206, @lgaborini) + # tidyclust 0.2.4 * The philentropy package is now used to calculate distances rather than Rfast. (#199)