inst/DEVELOPER_NOTES.md

Pkgdown

The pkgdown webpage will be automatically updated whenever a push is made to the main or master branch.

Steps for a release

Once a release is ready, all tests done and documentation checked, the Makefile in inst/doc is run. I usually run one target at a time starting with make movetovignettes then make build etc. This makefile will ensure that all the pieces of the tar.gz are in place. Before doing this, I build the User Guide and run it through a few compressors: Adobe and then https://github.com/atsa-es/pdfsizeopt-readme.

Spellcheck the whole package

#devtools::install_github("ropensci/spelling")
spelling::spell_check_package()
allfils <- c("README.md", "DESCRIPTION", "NEWS.md")
fils <- dir("inst/userguide/manual_files", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rnw")]
allfils <- c(allfils, fils)
fils <- dir("inst/derivations", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rnw")]
allfils <- c(allfils, fils)
fils <- dir("vignettes", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rmd")]
allfils <- c(allfils, fils)
fils <- dir("man", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rd")]
allfils <- c(allfils, fils)
spelling::spell_check_files(fils, ignore = spelling::get_wordlist(pkg = "."), lang = "en_US")

Derivations

Docs are in inst/derivations. Re-run if the derivation files change. Running the make file will update the inst/derivations/doc folder which is used for the files that are put in the inst/doc folder of a source file .tar.gz release.

cd inst/derivations
make

User Guide

Re-run with any new release. Running the make file will update the inst/userguide/doc folder which is used for the files that are put in the inst/doc folder of a source file .tar.gz release.

cd inst/userguide
make

You can update both by

cd inst
make --makefile=Makedoc

Check the documentation pdfs

Will be in inst/userguide/doc and inst/derivations/doc

Compress User Guide

Should be about 1.3M

Manually update the inst/doc for GitHub

So that users install the vignettes when they install from GitHub

Check the manual built by CRAN

setwd("~/Documents/GitHub")
devtools::build_manual(pkg="MARSS")

Check the vignettes

Run and check and then delete the detritus.

Basic Tests

rm -r ~/Dropbox/MARSS.Rcheck
R CMD check --timings --as-cran MARSS_3.11.7.tar.gz

Run internal tests

A note about these tests. I tried to break MARSS code with the tests and choose models and data that are difficult and weird. The tests will pump out many errors and warnings. Don't worry about that. Just watch if the test fails.

You can run all the tests with devtools::test() but I find running the tests one by one in RStudio is easier to make sense of since there are so many error messages. Open the test file and you will see a button to run tests. Some tests will show errors, but all tests should pass. Errors are correct if the test passes and result should be try-error.

These are the tests in tests/testthat. All should pass but some give warnings. See note test-GDF-example for a comment regarding differences on different OS.

This will warn about "MARSSparamCIs: No parSigma element returned by Hessian function. See marssMLE object errors (MLEobj$errors)". This is ok.

There will be some errors. This is correct. Test is to make sure these error messages appear.

This one shows not insignificant differences in the logLik tests (fails) when run on my MacBook Air (M1, 2020) versus my old Mac (Intel) or on a Linux (Posit.Cloud R 4.3, everything updated). If run on Linux, then everything should pass as the logLik hard coded values are from that OS.

This has the code from the inst/manual_files/KFAS.Rnw however the se.fit for output from predict() for KFAS models is removed because this is expected to be different. See the KFAS chapter at the end of the User Guide.

This is testing that kfss and kfas are returning the same values across a variety of models.

Lots of residuals warnings on this one as these are difficult models. "MARSSresiduals.tt1 reported warnings. See msg element of returned residuals object."" Warnings are correct, but all tests should pass. I kind of went overkill on the tests here.

There will be some warnings about MARSSresiduals.tT reporing warnings.

A long kind of excessive test but in 3.11.4 I was having trouble with the tt residuals code.

Check any reverse depends

Ready for final build

cd inst
make

However I usually run it one target at a time.

Now using the final tar.gz file do the final tests.

Check timings

cd ~/Dropbox
rm -r ~/Dropbox/MARSS.Rcheck
R CMD check --timings --as-cran MARSS_3.11.7.tar.gz

Check on other OS

Add cran-comments

Prepare for release:

Re-read the submission guidelines to see if anything changed: https://cran.r-project.org/submit.html

Check that package builds on Windows

Upload package to CRAN



eeholmes/MARSS documentation built on May 3, 2024, 10:03 p.m.