From 4b5ceb79ed67de27bb564b49fb6a8d4ca87514ff Mon Sep 17 00:00:00 2001 From: Peter Carbonetto Date: Tue, 2 Jul 2024 09:40:26 -0500 Subject: [PATCH] Skipped a few tests if on CRAN. --- DESCRIPTION | 2 +- R/fit_poisson_nmf.R | 2 +- tests/testthat/test_plots.R | 22 ++++++++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 277b478..308472a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Encoding: UTF-8 Type: Package Package: fastTopics -Version: 0.6-187 +Version: 0.6-188 Date: 2024-07-02 Title: Fast Algorithms for Fitting Topic Models and Non-Negative Matrix Factorizations to Count Data diff --git a/R/fit_poisson_nmf.R b/R/fit_poisson_nmf.R index 3e3b2ed..50941a4 100644 --- a/R/fit_poisson_nmf.R +++ b/R/fit_poisson_nmf.R @@ -449,7 +449,7 @@ fit_poisson_nmf <- function (X, k, fit0, numiter = 100, cat(sprintf("Running at most %d %s updates, %s extrapolation ", numiter,method.text, ifelse(control$extrapolate,"with","without"))) - cat("(fastTopics 0.6-187).\n") + cat("(fastTopics 0.6-188).\n") } # INITIALIZE ESTIMATES diff --git a/tests/testthat/test_plots.R b/tests/testthat/test_plots.R index 66a9d54..60d2b27 100644 --- a/tests/testthat/test_plots.R +++ b/tests/testthat/test_plots.R @@ -73,16 +73,6 @@ test_that("Test that other plotting functions work",{ expect_s3_class(p1,"ggplot") expect_s3_class(p2,"ggplot") - # Test tsne_plot and umap_plot. - capture.output(p1 <- tsne_plot(fit1,fill = "loading")) - capture.output(p2 <- tsne_plot(fit2,fill = "loading")) - capture.output(p3 <- umap_plot(fit1,fill = "loading",verbose = FALSE)) - capture.output(p4 <- umap_plot(fit2,fill = "loading",verbose = FALSE)) - expect_s3_class(p1,"ggplot") - expect_s3_class(p2,"ggplot") - expect_s3_class(p3,"ggplot") - expect_s3_class(p4,"ggplot") - # Test structure_plot. grouping <- factor(apply(poisson2multinom(fit1)$L,1,which.max)) capture.output(y <- drop(tsne_from_topics(poisson2multinom(fit1),dims = 1))) @@ -103,4 +93,16 @@ test_that("Test that other plotting functions work",{ capture.output(p2 <- plot(fit2)) expect_s3_class(p1,"ggplot") expect_s3_class(p2,"ggplot") + + skip_if(on_cran) + + # Test tsne_plot and umap_plot. + capture.output(p1 <- tsne_plot(fit1,fill = "loading")) + capture.output(p2 <- tsne_plot(fit2,fill = "loading")) + capture.output(p3 <- umap_plot(fit1,fill = "loading",verbose = FALSE)) + capture.output(p4 <- umap_plot(fit2,fill = "loading",verbose = FALSE)) + expect_s3_class(p1,"ggplot") + expect_s3_class(p2,"ggplot") + expect_s3_class(p3,"ggplot") + expect_s3_class(p4,"ggplot") })