From d2f03107c9a9f7fc85ce5d392458fb26fdd31184 Mon Sep 17 00:00:00 2001 From: Gregory Jefferis Date: Fri, 15 Nov 2024 11:42:19 +0000 Subject: [PATCH] only give across dataset message when ndatasets>1 * update test baseline --- R/partners.R | 3 ++- tests/testthat/test-cosine.R | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/R/partners.R b/R/partners.R index e789060..8619865 100644 --- a/R/partners.R +++ b/R/partners.R @@ -168,7 +168,8 @@ match_types <- function(x, group="type", partners="", min_datasets=Inf) { dplyr::ungroup() todrop <- xg %>% dplyr::filter(nd1) + message("Matching types across datasets. Keeping ", nrow(x) - nrow(todrop), "/", nrow(x), " ", substr(partners,1,nchar(partners)-1), " connections with total weight ", sum(x$weight) - sum(todrop$weight), "/", sum(x$weight), diff --git a/tests/testthat/test-cosine.R b/tests/testthat/test-cosine.R index 22f6b6d..3a1d1b4 100644 --- a/tests/testthat/test-cosine.R +++ b/tests/testthat/test-cosine.R @@ -25,9 +25,9 @@ test_that("cosine plots work", { skip_if(nofw, message = 'No flywire annotations available.') lalids=cf_ids(hemibrain="/type:LAL(00.+|044)", flywire = "/type:LAL00.+") - hc=cf_cosine_plot(lalids, heatmap = F) + suppressWarnings(suppressMessages(hc <- cf_cosine_plot(lalids, heatmap = F))) suppressWarnings(suppressMessages(expect_message(hc1 <- cf_cosine_plot(lalids, min_datasets = -1, heatmap = F), - "Dropping 0.*partner types"))) + "Keeping .*connections"))) suppressWarnings( suppressMessages( expect_equal(cf_cosine_plot(lalids, min_datasets = 1, heatmap = F),