Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 3.11.7 Progress #177

Open
27 of 40 tasks
eeholmes opened this issue May 16, 2023 · 5 comments
Open
27 of 40 tasks

version 3.11.7 Progress #177

eeholmes opened this issue May 16, 2023 · 5 comments
Assignees

Comments

@eeholmes
Copy link
Collaborator

eeholmes commented May 16, 2023

This release is mainly concerned with updates to allow the marssTMB package to integrate with MARSS.

  • Fix the articles tab

  • Get the manual to build on MARSS-User-Guide repo

  • Run checks without building the vignettes

devtools::check(document = FALSE, vignettes=FALSE)
  • Run examples only. Watch output as it comes out and look for anything odd.
devtools::run_examples(pkg="~/Documents/GitHub/MARSS", document=FALSE, fresh=TRUE)
  • spellcheck the whole package
#devtools::install_github("ropensci/spelling")
spelling::spell_check_package()
fils <- dir("vignettes/manual_files", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rnw")]
spelling::spell_check_files(fils, ignore = spelling::get_wordlist(pkg = "."), lang = "en_US")
  • Check Manual
setwd("~/Documents/GitHub")
devtools::build_manual(pkg="MARSS")
  • Build the package into tar.gz. Note do not use devtools::build() it destroys the inst/doc folder.
    Note, the Mac LaTeX installation doesn't install packages on the fly. You may need to install the needed packages. From terminal: tlmgr install imakeindex, tlmgr install collection-fontsrecommended, tlmgr install footmisc, tlmgr install appendix`, plus a few more in header.tex.

Open terminal

cd ~/Documents/GitHub
rm MARSS_3.11.4.tar.gz
R CMD build MARSS
rm -r ~/Dropbox/MARSS
rm ~/Dropbox/MARSS_3.11.4.tar.gz
cp MARSS_3.11.4.tar.gz ~/Dropbox/MARSS_3.11.4.tar.gz
cd ~/Dropbox
tar -xvzf MARSS_3.11.4.tar.gz
rm ~/Dropbox/MARSS/vignettes/Makefile
R CMD build --no-build-vignettes MARSS

Run version tests

  • Run this vignettes/versiontest.R

  • Run checks on the built package

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

Run internal tests

  • Run tests/model.R to set up models for tests
  • Then run devtools::test() but I find running the tests one by one in RStudio is easier to make sense of. Some tests will through errors, but all test should pass. Errors are correct if the test passes and result should be try-error.
    • test.coef expected [ FAIL 0 | WARN 8 | SKIP 0 | PASS 57 ]
    • test-forecast expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 76 ]
    • test-GDF expected on Linux OS [ FAIL 0 | WARN 0 | SKIP 0 | PASS 18 ] All pass on Linux, on M1 Mac the hard coded logLik are different up to delta 1 while on Linux they are the same.
    • test-KFAS expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 45 ]
    • test-MARSSkfss expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 68 ] In one model, R is < 1e-13. On Linux, one logLik test on line 81 fails although the par are the same within machine tolerance. On M1 Mac, the same test passes.
    • test-plotting expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 160 ]
    • test-print expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 120 ]
    • test-residualsHarvey expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 84 ]
    • test-structTS expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 5 ]
    • test-tt expected [ FAIL 0 | WARN 0 | SKIP 0 | PASS 4403 ]

Rerun the plot testing Rmds in inst/testing-releases and make sure the plots look ok

  • test-autoplot
  • test-plot
  • test-plot-kfss-kfas
  • test-predict-plot
  • test-resids-plot

Check the documentation pdfs

  • EMDerivation
  • Quick Start
  • Residuals
  • User Guide

Compress documentation pdfs

  • Manually compress the pdfs in the doc folder Dropbox/MARSS/inst/doc
  • Rebuild package with smaller docs, and then re-Run checks on the built package to see that it passes size checks
R CMD build --no-build-vignettes MARSS
rm -r ~/Dropbox/MARSS.Rcheck
R CMD check --timings --as-cran MARSS_3.11.4.tar.gz

Update the doc folder for GitHub. This has to be done manually by copying from

  • Dropbox/MARSS/inst/doc into GitHub/MARSS/inst/doc

Prepare for release:

Update the doc folder on GitHub. This has to be done manually

  • Copy Dropbox/MARSS/inst/doc into GitHub/MARSS/inst/doc

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

The items below are for cases where you are submitting the package files without any extra processing. I process my vignette PDFs separately, so the below won't work. But when submitting there is a link to check the tar.gz file on Windows.

  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
@eeholmes eeholmes self-assigned this May 16, 2023
@eeholmes
Copy link
Collaborator Author

eeholmes commented May 19, 2023

need to recheck the test-MARSSkfss:

with MARSS 3.11.7

  • all pass on M1 Mac, 1 fail (logLik line 81 for model with R < 1e-13) on Linux (Posit Cloud)

same behavior occurs with MARSS 3.11.4 and 3.11.3. I think it is a numerical issue at these really small R values.

@eeholmes
Copy link
Collaborator Author

eeholmes commented May 19, 2023

Tests run on

  • packageVersion("KFAS") ‘1.5.0’
  • packageVersion("MARSS") ‘3.11.7’

On Posit.Cloud (linux) and M1 MacBook Air 2020. With R 4.2.3. Compared to MARSS 3.11.4 and some test compared on MARSS 3.11.3.

@eeholmes
Copy link
Collaborator Author

State smoothation residuals problem for plot

image

@eeholmes
Copy link
Collaborator Author

I cannot replicate. I think the code was something like

dat <- t(harborSealWA)
dat <- dat[2:4, ] # remove the year row
# fit a model with 1 hidden state and 3 observation time series
kemfit <- MARSS(dat, model=list(Q="unconstrained"))
resids=residuals(kemfit, type="tT")
plot(resids)

But perhaps this is marssTMB specific?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant