Skip to content

Commit

Permalink
Merge pull request #381 from poissonconsulting/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
joethorley authored Sep 25, 2024
2 parents 43c313e + fa11272 commit 4a79550
Show file tree
Hide file tree
Showing 270 changed files with 3,222 additions and 4,185 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md → .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ representative at an online or offline event.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at .github/.
reported to the community leaders responsible for enforcement at [email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

#
on:
push:
branches: [main, dev]
branches: [main, master]
pull_request:
branches: [main, dev]
branches: [main, master, dev]

name: R-CMD-check

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -23,19 +25,20 @@ jobs:

- {os: windows-latest, r: 'release'}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}
- {os: windows-latest, r: 'oldrel-3'}

- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -53,3 +56,4 @@ jobs:
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
2 changes: 1 addition & 1 deletion .github/workflows/paper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
journal: joss
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: paper
path: paper/paper.pdf
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: main
branches: [main, master]
pull_request:
branches: main
branches: [main, master, dev]
release:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
Expand All @@ -22,7 +24,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -41,7 +43,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,60 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: main
branches: [main, master]
pull_request:
branches: main
branches: [main, master, dev]

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: macos-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
covr::codecov(
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

*.html

docs/
inst/docs/
inst/doc
paper/paper.pdf
scripts/boron_samples1
scripts/checks.md
/docs/
/inst/docs/
/paper/paper.pdf
/scripts/boron_samples1
/scripts/checks.md
21 changes: 10 additions & 11 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: ssdtools
Title: Species Sensitivity Distributions
Version: 1.0.6.9016
Version: 1.0.6.9018
Authors@R: c(
person("Joe", "Thorley", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7683-4592")),
Expand All @@ -15,9 +15,7 @@ Authors@R: c(
person("Doug", "Spry", role = "ctb"),
person("Rick", "van Dam", role = "ctb"),
person("Graham", "Batley", role = "ctb"),
person("Yulia", "Cuthbertson", role = "ctb"),
person("Tony", "Bigwood", role = "ctb"),
person("Michael", "Antenucci", role = "ctb"),
person("Ali", "Azizishirazi", role = "ctb"),
person("Nadine", "Hussein", , "[email protected]", role = "ctb",
comment = c(ORCID = "0000-0003-4470-8361")),
Expand All @@ -38,9 +36,9 @@ Description: Species sensitivity distributions are cumulative probability
different species as described by Posthuma et al.(2001)
<isbn:9781566705783>. The ssdtools package uses Maximum Likelihood to
fit distributions such as the gamma, log-logistic, log-normal and
log-normal log-normal mixture. Multiple distributions can
be averaged using Akaike Information Criteria. Confidence intervals
on hazard concentrations and proportions are produced by parametric
log-normal log-normal mixture. Multiple distributions can be averaged
using Akaike Information Criteria. Confidence intervals on hazard
concentrations and proportions are produced by parametric
bootstrapping.
License: Apache License (== 2.0) | file LICENSE
URL: https://github.com/bcgov/ssdtools, https://bcgov.github.io/ssdtools/
Expand All @@ -53,6 +51,7 @@ Imports:
furrr,
generics,
ggplot2,
glue,
goftest,
graphics,
grid,
Expand All @@ -61,6 +60,7 @@ Imports:
plyr,
purrr,
Rcpp,
rlang,
scales,
ssddata,
stats,
Expand All @@ -69,7 +69,7 @@ Imports:
TMB,
universals,
utils,
VGAM
withr
Suggests:
actuar,
covr,
Expand All @@ -80,22 +80,21 @@ Suggests:
fitdistrplus,
foreach,
future,
glue,
grDevices,
knitr,
latex2exp,
magrittr,
mle.tools,
patchwork,
R.rsp,
readr,
reshape2,
rlang,
rmarkdown,
testthat,
testthat (>= 3.0.0),
tidyr,
tidyselect,
tinytex,
withr
VGAM
LinkingTo:
Rcpp,
RcppEigen,
Expand Down
12 changes: 8 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export(is_censored)
export(logLik)
export(nobs)
export(npars)
export(params)
export(pgompertz)
export(plgumbel)
export(plot)
Expand All @@ -68,6 +69,7 @@ export(rgompertz)
export(rlgumbel)
export(scale_color_ssd)
export(scale_colour_ssd)
export(ssd_censor_data)
export(ssd_data)
export(ssd_dists)
export(ssd_dists_all)
Expand Down Expand Up @@ -96,6 +98,7 @@ export(ssd_hc_burrlioz)
export(ssd_hp)
export(ssd_hp_bcanz)
export(ssd_is_censored)
export(ssd_label_comma)
export(ssd_licensing_md)
export(ssd_match_moments)
export(ssd_min_pmix)
Expand Down Expand Up @@ -145,11 +148,10 @@ export(tidy)
export(waiver)
import(chk)
import(ggplot2)
import(rlang)
importFrom(Rcpp,sourceCpp)
importFrom(TMB,MakeADFun)
importFrom(TMB,sdreport)
importFrom(VGAM,gompertz)
importFrom(VGAM,vglm)
importFrom(abind,abind)
importFrom(furrr,furrr_options)
importFrom(furrr,future_map)
Expand All @@ -159,6 +161,7 @@ importFrom(generics,tidy)
importFrom(ggplot2,autoplot)
importFrom(ggplot2,sym)
importFrom(ggplot2,waiver)
importFrom(glue,glue)
importFrom(goftest,ad.test)
importFrom(goftest,cvm.test)
importFrom(graphics,par)
Expand All @@ -173,15 +176,16 @@ importFrom(grid,segmentsGrob)
importFrom(lifecycle,deprecate_soft)
importFrom(lifecycle,deprecate_stop)
importFrom(lifecycle,deprecate_warn)
importFrom(lifecycle,deprecated)
importFrom(lifecycle,expect_defunct)
importFrom(lifecycle,expect_deprecated)
importFrom(parallel,nextRNGStream)
importFrom(parallel,nextRNGSubStream)
importFrom(plyr,summarise)
importFrom(purrr,list_assign)
importFrom(purrr,transpose)
importFrom(scales,comma)
importFrom(scales,label_percent)
importFrom(scales,manual_pal)
importFrom(scales,percent)
importFrom(scales,trans_breaks)
importFrom(ssddata,gm_mean)
importFrom(stats,coef)
Expand Down
18 changes: 13 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- NEWS.md is maintained by https://fledge.cynkra.com, contributors should not edit this file -->

# ssdtools 1.0.6.9016
# ssdtools 1.0.6.9018

## Additions

Expand All @@ -11,14 +11,20 @@
- `samples` argument to include bootstrap samples as list of numeric vector(s).
- `save_to` argument to specify a directory in which to save the bootstrap datasets as csv files and parameter estimates as rds files. The files are named `data_000000001_xx.csv` and `estimates_000000001_xx.rds` etc where `xx` is the distribution. The parent data set and estimates are named `boot_000000000_xx.csv` and `estimates_000000000_xx.csv`.
- Added `ssd_hp_bcanz()` and `ssd_hp.fitburrlioz()` function to get hazard proportions.
- Added `ssd_label_comma()` for x-axis labels.
- Added `trans = "log10"` and `add_x = 0` arguments to `ssd_plot()` and `ssd_plot_data()`.
- Added `ssd_pmulti()`, `ssd_qmulti()` and `ssd_rmulti()` for combined mixture distributions.
- Added `ssd_exx()` functions to get default parameter estimates for distributions.
- Added `ssd_censor_data()` to censor data.
- Added David Fox and Rebecca Fisher as co-authors.
- Added `npars` argument to `ssd_dists_bcanz()`.
- Added `big.mark = ","` for x-axis labels and `suffix = "%"` to y-axis labels to plotting functions.

## Modifications

- Only non-parametric bootstrap for censored data.
- Changed `at_boundary_ok = TRUE` to ensure `lnorm_lnorm` mixture distribution included.
- Changed `computable = TRUE` to as not required for bootstrapping.
- Changed to `min_pboot = 0.95` for all functions.
- Changed `min_pmix = 0` to `min_pmix = ssd_min_pmix(nrow(data))` to by default
give set min_pmix to be `0.1` or `3/nrow(data)` if greater to improve convergence of mixture models.
Expand All @@ -43,11 +49,13 @@ give set min_pmix to be `0.1` or `3/nrow(data)` if greater to improve convergenc

## Deprecation

- Soft-deprecated `comma_signif()`.
- Soft-deprecated argument `percent = 5` for `proportion = 0.05` for `ssd_hc()` and `predict()`.
- `is_censored()`, `ssd_plot_cf()` and `comma_signif(...)` now warn deprecated unconditionally.
- `plot.fitdists()` now defunct.
- Removed defunct `ssd_cfplot()`
- `is_censored()`, `plot.fitdists()`, `ssd_plot_cf()` `geom_ssd()`, `stat_ssd()`, `xgompertz()`, `xlgumbel`, `ssd_hc_burrlioz()` now defunct.
- Deprecated `ssd_wqg_bc()` and `ssd_wqg_burrlioz()`. (#75).
- Deprecated `ssd_fit_bcanz()` and `ssd_hp_bcanz()`.
- Removed `ccme_data` and `ccme_boron` data set.
- Removed `pearson1000` data set (now in `ssdtests` data).

# ssdtools 1.0.6

Expand Down Expand Up @@ -91,7 +99,7 @@ ssdtools version 1.0.0 is the first major release of `ssdtools` with some import

## Fitting

An important change to the functionality of `ssd_fit_dists()` was to switch from model fitting using [`fitdistrplus`](https://github.com/aursiber/fitdistrplus) to [`TMB`](https://github.com/kaskr/adcomp) which has resulted in improved handling of censored data.
An important change to the functionality of `ssd_fit_dists()` was to switch from model fitting using [`fitdistrplus`](https://github.com/lbbe-software/fitdistrplus) to [`TMB`](https://github.com/kaskr/adcomp) which has resulted in improved handling of censored data.
Although it was hoped that model fitting would be faster this is currently not the case.

As a result of the change the `fitdists` objects returned by `ssd_fit_dists()` from previous versions of `ssdtools` are not compatible with the major release and should be regenerated.
Expand Down
Loading

0 comments on commit 4a79550

Please sign in to comment.