Skip to content

Commit

Permalink
only give across dataset message when ndatasets>1
Browse files Browse the repository at this point in the history
* update test baseline
  • Loading branch information
jefferis committed Nov 15, 2024
1 parent 0a7db6a commit d2f0310
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion R/partners.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ match_types <- function(x, group="type", partners="", min_datasets=Inf) {
dplyr::ungroup()
todrop <- xg %>%
dplyr::filter(nd<min_datasets)
message("Matching types across datasets. Keeping ",
if(ndatasets>1)
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),
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-cosine.R
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit d2f0310

Please sign in to comment.