Skip to content

Commit 92cd584

Browse files
committed
Merge branch 'main' into index-split
2 parents 5a7ca7e + b735815 commit 92cd584

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3438
-1075
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222
^vignettes/web_only$
2323
revdep/
2424
^vignettes/articles$
25+
^doc$
26+
^Meta$
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
on: workflow_dispatch
2+
3+
name: R-CMD-check-with-valgrind
4+
5+
jobs:
6+
R-CMD-check:
7+
if: "! contains(github.event.head_commit.message, '[skip ci]')"
8+
runs-on: ${{ matrix.config.os }}
9+
10+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
config:
16+
# - {os: windows-latest, r: 'release'}
17+
# - {os: macOS-latest, r: 'release'}
18+
# - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
19+
- { os: ubuntu-latest, r: "release" }
20+
# - {os: ubuntu-latest, r: 'oldrel-1'}
21+
22+
env:
23+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
R_KEEP_PKG_SOURCE: yes
25+
_R_CHECK_USE_VALGRIND_: true
26+
_R_CHECK_MATRIX_DATA_: true
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- uses: r-lib/actions/setup-pandoc@v2
32+
33+
- uses: r-lib/actions/setup-r@v2
34+
with:
35+
r-version: ${{ matrix.config.r }}
36+
http-user-agent: ${{ matrix.config.http-user-agent }}
37+
use-public-rspm: true
38+
39+
- name: Install remotes
40+
run: install.packages('remotes')
41+
shell: Rscript {0}
42+
43+
- name: Install system dependencies
44+
if: runner.os == 'Linux'
45+
run: |
46+
while read -r cmd
47+
do
48+
eval sudo $cmd
49+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04.2"))')
50+
sudo apt-get install --yes valgrind
51+
52+
- uses: r-lib/actions/setup-r-dependencies@v2
53+
with:
54+
extra-packages: |
55+
any::rcmdcheck
56+
needs: check
57+
58+
- name: Check with valgrind
59+
env:
60+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
61+
_R_CHECK_FORCE_SUGGESTS_: false
62+
run: rcmdcheck::rcmdcheck(args = c("--use-valgrind", "--no-manual", "--as-cran", "--ignore-vignettes", "--no-build-vignettes"), build_args = c("--no-manual", "--no-build-vignettes"), error_on = "error", check_dir = "check")
63+
shell: Rscript {0}
64+
65+
- name: Upload check results
66+
if: failure()
67+
uses: actions/upload-artifact@main
68+
with:
69+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
70+
path: check

.github/workflows/R-CMD-check.yaml

Lines changed: 12 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
31
on:
42
push:
5-
branches: [main, dev, fmesher2]
3+
branches: [main, dev]
64
pull_request:
75
branches: [main, dev]
86

@@ -26,91 +24,28 @@ jobs:
2624
# - {os: ubuntu-latest, r: 'oldrel-1'}
2725

2826
env:
29-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
30-
RSPM: ${{ matrix.config.rspm }}
3127
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3228
R_KEEP_PKG_SOURCE: yes
3329

3430
steps:
35-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v4
32+
33+
- uses: r-lib/actions/setup-pandoc@v2
3634

3735
- uses: r-lib/actions/setup-r@v2
3836
with:
3937
r-version: ${{ matrix.config.r }}
4038
http-user-agent: ${{ matrix.config.http-user-agent }}
4139
use-public-rspm: true
4240

43-
- uses: r-lib/actions/setup-pandoc@v2
44-
45-
- name: Query dependencies
46-
run: |
47-
install.packages('remotes')
48-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
49-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
50-
shell: Rscript {0}
51-
52-
- name: Cache R packages
53-
if: runner.os != 'Windows'
54-
uses: actions/cache@v2
41+
- uses: r-lib/actions/setup-r-dependencies@v2
5542
with:
56-
path: ${{ env.R_LIBS_USER }}
57-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
58-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
59-
60-
- name: Install system dependencies
61-
if: runner.os == 'Linux'
62-
run: |
63-
while read -r cmd
64-
do
65-
eval sudo $cmd
66-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
67-
68-
- name: Install dependencies macOS
69-
if: runner.os == 'macOS'
70-
run: |
71-
remotes::install_deps(dependencies = TRUE)
72-
remotes::install_cran("sf")
73-
remotes::install_cran("rcmdcheck")
74-
remotes::install_cran("textshaping")
75-
remotes::install_github("pbs-assess/sdmTMBextra")
76-
install.packages("Matrix", type = "source")
77-
install.packages("TMB", type = "source")
78-
shell: Rscript {0}
79-
80-
- name: Install dependencies Ubuntu
81-
if: runner.os == 'Linux'
82-
run: |
83-
remotes::install_deps(dependencies = TRUE)
84-
remotes::install_cran("knitr")
85-
remotes::install_cran("rmarkdown")
86-
remotes::install_cran("rcmdcheck")
87-
remotes::install_github("pbs-assess/sdmTMBextra")
88-
install.packages("Matrix", type = "source")
89-
install.packages("TMB", type = "source")
90-
shell: Rscript {0}
91-
92-
- name: Install dependencies Windows
93-
if: runner.os == 'Windows'
94-
run: |
95-
remotes::install_deps(dependencies = TRUE)
96-
remotes::install_cran("knitr")
97-
remotes::install_cran("rmarkdown")
98-
remotes::install_cran("rcmdcheck")
99-
remotes::install_github("pbs-assess/sdmTMBextra")
100-
install.packages("Matrix", type = "source")
101-
install.packages("TMB", type = "source")
102-
shell: Rscript {0}
103-
104-
- name: Check
105-
env:
106-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
107-
_R_CHECK_FORCE_SUGGESTS_: false
108-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", "--ignore-vignettes", "--no-build-vignettes"), build_args = c("--no-manual", "--no-build-vignettes"), error_on = "error", check_dir = "check")
109-
shell: Rscript {0}
43+
extra-packages: |
44+
any::rcmdcheck
45+
any::textshaping
46+
needs: check
11047

111-
- name: Upload check results
112-
if: failure()
113-
uses: actions/upload-artifact@main
48+
- uses: r-lib/actions/check-r-package@v2
11449
with:
115-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
116-
path: check
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ README_cache/*
1818
Dockerfile
1919
revdep/
2020
scratch/VAST-EAO*
21+
tags
22+
Session.vim

DESCRIPTION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: sdmTMB
33
Title: Spatial and Spatiotemporal SPDE-Based GLMMs with 'TMB'
4-
Version: 0.6.0.9013
4+
Version: 0.6.0.9038
55
Authors@R: c(
66
person(c("Sean", "C."), "Anderson", , "sean@seananderson.ca",
77
role = c("aut", "cre"),
@@ -60,11 +60,10 @@ Copyright: inst/COPYRIGHTS
6060
URL: https://pbs-assess.github.io/sdmTMB/, https://github.com/pbs-assess/sdmTMB
6161
BugReports: https://github.com/pbs-assess/sdmTMB/issues
6262
Depends:
63-
R (>= 3.5.0)
63+
R (>= 4.1.0)
6464
Imports:
6565
assertthat,
6666
abind,
67-
clisymbols,
6867
cli,
6968
fmesher,
7069
fishMod,
@@ -95,6 +94,7 @@ Suggests:
9594
knitr,
9695
rmarkdown,
9796
sf,
97+
spatstat.data,
9898
splancs,
9999
testthat,
100100
tibble,

NAMESPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method(cAIC,sdmTMB)
34
S3method(coef,sdmTMB)
45
S3method(confint,sdmTMB)
56
S3method(df.residual,sdmTMB)
@@ -21,10 +22,12 @@ S3method(simulate,sdmTMB)
2122
S3method(summary,sdmTMB)
2223
S3method(terms,sdmTMB)
2324
S3method(tidy,sdmTMB)
25+
S3method(tidy,sdmTMB_cv)
2426
S3method(vcov,sdmTMB)
2527
export(Beta)
2628
export(add_barrier_mesh)
2729
export(add_utm_columns)
30+
export(cAIC)
2831
export(censored_poisson)
2932
export(delta_beta)
3033
export(delta_gamma)
@@ -38,6 +41,7 @@ export(delta_truncated_nbinom1)
3841
export(delta_truncated_nbinom2)
3942
export(dharma_residuals)
4043
export(extract_mcmc)
44+
export(gamma_cv)
4145
export(gamma_mix)
4246
export(gather_sims)
4347
export(gengamma)

NEWS.md

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,91 @@
1-
# sdmTMB (development version)
1+
# sdmTMB 0.7.0
2+
3+
## New features
4+
5+
* Add option for random slopes, or random intercepts to be passed in in
6+
`lme4` style formulas, `density ~ (1 | fyear)` or `density ~ (depth | fyear)`,
7+
Matches output of `lme4` and `glmmTMB`, and summarizes output with `tidy()`.
8+
9+
* Add `project()` experimental function.
10+
11+
* Add `get_eao()` to calculate effective area occupied.
12+
13+
* Allow predicting on new data with `t2()` smoothers. #413
14+
15+
* Add priors for `breakpt()` and `logistic()` parameters. #403
16+
17+
* Add priors on time-varying SD parameters (`sigma_V`).
18+
19+
* Add `cAIC()` for calculating *conditional* AIC. Theory based on
20+
<https://arxiv.org/abs/2411.14185>; also see
21+
<https://doi.org/10.1002/ecy.4327>. J.T. Thorson wrote the function code.
22+
EDF (effective degrees of freedom) will ultimately be further split
23+
(e.g., split by smoothers) and added to `summary.sdmTMB()`. #383 #387
24+
25+
* Add EDF (effective degrees of freedom) printing to smoothers with
26+
`print.sdmTMB()` and `summary.sdmTMB()`. Set argument `edf = TRUE`.
27+
E.g. `print(fit, edf = TRUE)`. #383 #387
228

329
* At experimental function `get_index_split()`, which takes care of
430
splitting a prediction grid by time, undoing the prediction and
531
area-integration index calculations for each chunk to save memory.
632

7-
* Add `return_tmb_report` to `simulate.sdmTMB()`.
8-
933
* Add `newdata` argument to `simulate.sdmTMB()`. This enables simulating on
1034
a new data frame similar to how one would predict on new data.
1135

1236
* Add `mle_mvn_samples` argument to `simulate.sdmTMB()`. Defaults to "single".
1337
If "multiple", then a sample from the random effects is taken for each
1438
simulation iteration.
1539

16-
* Add `project()` experimental function.
40+
* Allow for specifying only lower or upper limits. #394
41+
42+
* `sdmTMB_cv()` gains a `tidy()` and `print()` method for output. #319
43+
44+
* `simulate.sdmTMB()` method now has an `return_tmb_report` argument.
1745

18-
* Add print method for `sdmTMB_cv()` output. #319
46+
## New vignettes/articles
47+
48+
* Add forecasting and presence-only article vignettes. See
49+
<https://pbs-assess.github.io/sdmTMB/articles/>
50+
51+
* Add vignette on multispecies models with sdmTMB (or any case where one wants
52+
additional spatial and or spatiotemporal fields by some group).
53+
See <https://pbs-assess.github.io/sdmTMB/articles/>
54+
55+
## Minor improvements and fixes
56+
57+
* Fix bug in a check in `make_mesh()` around if coordinates look
58+
overly large. #427
59+
60+
* Re-enable bias correction for `get_cog()` (get center of gravity).
61+
62+
* Add check for `Inf`/`-Inf` values before fitting. #408
63+
64+
* Add linear component of smoothers to `tidy()`. #90
65+
66+
* Add time varying AR(1) correlation to `tidy()` and `print()`. #374
67+
68+
* Warn if parameter limits are set with `newton_loops > 0`. #394
69+
70+
* Fix bug in `est` column when predicting on new data with Poisson-link
71+
delta models with `type = "link"` and `re_form = NA`. #389
72+
73+
* Fix bug in `s95` parameter reporting from the `tidy()` method. `s95` is
74+
present in the logistic threshold models. The model itself was fine but the
75+
`s95` parameter was supposed to be reported by `tidy()` as a combination of two
76+
other parameters. This also affected the output in `print()`/`summary()`.
1977

2078
* Add progress bar to `simulate.sdmTMB()`. #346
2179

2280
* Add AUC and TSS examples to cross validation vignette. #268
2381

24-
* Add `model` (linear predictor number) argument to coef() method. Also,
82+
* Add `model` (linear predictor number) argument to `coef()` method. Also,
2583
write documentation for `?coef.sdmTMB`. #351
2684

27-
* Add helpful error message if some coordinates in make_mesh() are NA. #365
85+
* Add helpful error message if some coordinates in `make_mesh()` are `NA`. #365
2886

2987
* Add informative message if fitting with an offset but predicting with offset
30-
argument left at NULL on newdata. #372
88+
argument left at `NULL` on `newdata`. #372
3189

3290
* Fix passing of `offset` argument through in `sdmTMB_cv()`. Before it was being
3391
omitted in the prediction (i.e., set to 0). #372
@@ -41,8 +99,10 @@
4199
distribution first before multiplying by the probability of a non-zero.
42100
Thanks to @tom-peatman #350
43101

44-
* Add `get_eao()` to calculate effective area occupied.
45-
102+
* Add option for `area` to be passed in as the name of a column in the
103+
data frame to be used for area weighting. Used in `get_index()`,
104+
`get_cog()`, `get_eao()`, etc.
105+
46106
# sdmTMB 0.6.0
47107

48108
* Pass several arguments to `DHARMa::plotQQunif()`.

0 commit comments

Comments
 (0)