Skip to content

Commit

Permalink
Skipped a few tests if on CRAN.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcarbo committed Jul 2, 2024
1 parent a21be7b commit 4b5ceb7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/fit_poisson_nmf.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 12 additions & 10 deletions tests/testthat/test_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand All @@ -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")
})

0 comments on commit 4b5ceb7

Please sign in to comment.