nicholasjclark / mvgam

{mvgam} R 📦 to fit Dynamic Bayesian Generalized Additive Models for multivariate modeling and forecasting
https://nicholasjclark.github.io/mvgam/
Other
114 stars 14 forks source link

Many tests get skipped for unclear reason [ FAIL 0 | WARN 0 | SKIP 16 | PASS 35 ] #69

Closed barracuda156 closed 3 months ago

barracuda156 commented 3 months ago
R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: powerpc-apple-darwin10.0.0d2 (32-bit)

> library(testthat)
> library(mvgam)
Loading required package: brms
Loading required package: Rcpp
Loading 'brms' package (version 2.21.6). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').

Attaching package: 'brms'

The following object is masked from 'package:stats':

    ar

Welcome to mvgam. Please cite as: Clark, NJ, and Wells, K. 2022. Dynamic Generalized Additive Models (DGAMs) for forecasting discrete ecological time series. Methods in Ecology and Evolution, 2022, https://doi.org/10.1111/2041-210X.13974
> 
> test_check("mvgam")
[ FAIL 0 | WARN 0 | SKIP 16 | PASS 35 ]

══ Skipped tests (16) ══════════════════════════════════════════════════════════
• On CRAN (16): 'test-RW.R:3:1', 'test-binomial.R:4:1', 'test-dynamic.R:3:1',
  'test-example_processing.R:4:1', 'test-families.R:21:3', 'test-gp.R:3:1',
  'test-marginaleffects.R:3:1', 'test-monotonic.R:4:1',
  'test-mvgam-methods.R:3:1', 'test-mvgam.R:128:1', 'test-mvgam_priors.R:4:1',
  'test-nmixture.R:4:1', 'test-offset.R:3:1', 'test-piecewise.R:83:3',
  'test-piecewise.R:105:3', 'test-update.R:3:1'

[ FAIL 0 | WARN 0 | SKIP 16 | PASS 35 ]
> 
> proc.time()
   user  system elapsed 
 30.800   2.698  34.364 

No failures with tests, but many of them are skipped, why is that? The only dependency which I have incomplete is R-cmdstanr (package itself is installed, but CmdStan is not, so it won't be properly usable).

barracuda156 commented 3 months ago

The rest passes fine.

* using log directory ‘/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_R_R-mvgam/R-mvgam/work/mvgam/mvgam.Rcheck’
* using R version 4.4.1 (2024-06-14)
* using platform: powerpc-apple-darwin10.0.0d2 (32-bit)
* R was compiled by
    gcc-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
    GNU Fortran (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0
* running under: OS X Snow Leopard 10.6
* using session charset: UTF-8
* using options ‘--no-manual --no-build-vignettes’
* checking for file ‘mvgam/DESCRIPTION’ ... OK
* this is package ‘mvgam’ version ‘1.1.2’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘mvgam’ can be installed ... OK
* used C++ compiler: ‘g++-mp-13 (MacPorts gcc13 13.3.0_0+stdlib_flag) 13.3.0’
* used SDK: ‘NA’‘NA’‘NA’‘NA’‘NA’‘NA’
* checking installed package size ... NOTE
  installed size is  5.3Mb
  sub-directories of 1Mb or more:
    R     1.8Mb
    doc   2.4Mb
* checking package directory ... OK
* checking ‘build’ directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking code files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* checking whether the package can be loaded ... OK
* checking whether the package can be loaded with stated dependencies ... OK
* checking whether the package can be unloaded cleanly ... OK
* checking whether the namespace can be loaded with stated dependencies ... OK
* checking whether the namespace can be unloaded cleanly ... OK
* checking loading without being on the library search path ... OK
* checking whether startup messages can be suppressed ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of ‘data’ directory ... OK
* checking data for non-ASCII characters ... OK
* checking LazyData ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking R/sysdata.rda ... OK
* checking line endings in C/C++/Fortran sources/headers ... OK
* checking use of PKG_*FLAGS in Makefiles ... OK
* checking compiled code ... OK
* checking installed files from ‘inst/doc’ ... OK
* checking files in ‘vignettes’ ... OK
* checking examples ... OK
* checking for unstated dependencies in ‘tests’ ... OK
* checking tests ... OK
  Running ‘testthat.R’
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes ... OK
* checking running R code from vignettes ... ERROR
Errors in running code in vignettes:
when running code in ‘data_in_mvgam.Rmd’
  ...

Number of Fisher Scoring iterations: 6

> summary(gam(y ~ series + s(time, by = series), data = simdat$data_train, 
+     family = poisson()))

  When sourcing ‘data_in_mvgam.R’:
Error: could not find function "gam"
Execution halted
when running code in ‘nmixtures.Rmd’
  ...

> plot(mod, type = "smooths", trend_effects = TRUE)

> plot_predictions(mod, condition = "species", type = "detection") + 
+     ylab("Pr(detection)") + ylim(c(0, 1)) + theme_classic() + 
+     theme(leg .... [TRUNCATED] 

  When sourcing ‘nmixtures.R’:
Error: could not find function "plot_predictions"
Execution halted

  ‘data_in_mvgam.Rmd’ using ‘UTF-8’... failed
  ‘forecast_evaluation.Rmd’ using ‘UTF-8’... OK
  ‘mvgam_overview.Rmd’ using ‘UTF-8’... OK
  ‘nmixtures.Rmd’ using ‘UTF-8’... failed
  ‘shared_states.Rmd’ using ‘UTF-8’... OK
  ‘time_varying_effects.Rmd’ using ‘UTF-8’... OK
  ‘trend_formulas.Rmd’ using ‘UTF-8’... OK
* checking re-building of vignette outputs ... SKIPPED
* DONE
Status: 1 ERROR, 1 NOTE
nicholasjclark commented 3 months ago

Thanks @barracuda156. This is standard practice for R packages that use tests that would fail CRAN checks for taking too long to complete (https://r-pkgs.org/testing-advanced.html). If you would like to run these tests and vignettes on your own system, you will need to supply an environment variable for NOT_CRAN, i.e.

Sys.setenv(NOT_CRAN = TRUE)
barracuda156 commented 3 months ago

Thank you, got it.

Running vignettes took about 6 hours, so perhaps I will let those tests be skipped :)

I close this issue, but keeping another one open (re vignettes errors): https://github.com/nicholasjclark/mvgam/issues/68