Skip to content

Commit

Permalink
Merge pull request #162 from rsetienne/develop
Browse files Browse the repository at this point in the history
v4.4.1
  • Loading branch information
rsetienne authored Oct 21, 2023
2 parents a9a523c + b0d29f2 commit 2051f8e
Show file tree
Hide file tree
Showing 71 changed files with 1,263 additions and 747 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
^\.vscode$
^dummy\.R
^LICENSE\.md$
^_pkgdown\.yml$
^docs$
^pkgdown$
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

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

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ src/*.gcno
**/.DS_Store
**/Rplots.pdf
Meta
docs
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: DAISIE
Type: Package
Title: Dynamical Assembly of Islands by Speciation, Immigration and Extinction
Version: 4.4.0
Date: 2023-03-29
Version: 4.4.1
Date: 2023-10-20
Depends: R (>= 4.2.0)
biocViews:
Imports:
Expand Down Expand Up @@ -114,6 +114,7 @@ NeedsCompilation: yes
SystemRequirements: C++17
Encoding: UTF-8
VignetteBuilder: knitr
URL: https://github.com/rsetienne/DAISIE
URL: https://github.com/rsetienne/DAISIE,
https://rsetienne.github.io/DAISIE/
BugReports: https://github.com/rsetienne/DAISIE/issues
RoxygenNote: 7.2.3
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# DAISIE 4.4.1

* Fix bug in the calculation of shift loglikelihoods.
* Fix bug where parameters being optimized could incorrectly be `Inf` #159 #160 (@joshwlambert).
* `DAISIE_SR_loglik_CS_M1()` is now `DAISIE_loglik_CS_shift()`.
* New pkgdown website.
* Several improvements to the relaxed rate code.


# DAISIE 4.4.0

* No longer include patched version of `boost/numeric/odeint/stepper/bulirsch_stoer.hpp`,
Expand Down
2 changes: 1 addition & 1 deletion R/DAISIE_ML1.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ DAISIE_loglik_all_choosepar <- function(trparsopt,
} else {
trpars1 <- rep(0, 6)
prop_type2_present <- which(idparsfix == 11)
if(!is.null(prop_type2_present)) {
if (length(prop_type2_present) > 0) {
trparsfix <- trparsfix[-prop_type2_present]
idparsfix <- idparsfix[-prop_type2_present]
}
Expand Down
2 changes: 1 addition & 1 deletion R/DAISIE_ML_CS.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#' \code{\link{DAISIE_sim_cr_shift}}
#' @references Valente, L.M., A.B. Phillimore and R.S. Etienne (2015).
#' Equilibrium and non-equilibrium dynamics simultaneously operate in the
#' Galapagos islands. Ecology Letters 18: 844-852. <DOI:10.1111/ele.12461>.
#' Galapagos islands. Ecology Letters 18: 844-852. <doi:10.1111/ele.12461>.
#' @keywords models
#' @examples
#'
Expand Down
16 changes: 10 additions & 6 deletions R/DAISIE_SR_loglik_CS.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,17 @@ DAISIE_SR_loglik_CS <- DAISIE_SR_loglik_all <- function(
return(check_shift_loglik)
}
cond = pars2[3]
logp0 = DAISIE_SR_loglik_CS_M1(
pars1 = pars1,
logp0 = DAISIE_loglik_CS_shift(
pars1 = pars1[1:10],
pars2 = pars2,
brts = datalist[[1]]$island_age,
stac = 0,
missnumspec = 0,
methode = methode,
abstolint = abstolint,
reltolint = reltolint
reltolint = reltolint,
verbose = verbose,
tshift = pars1[11]
)
if (is.null(datalist[[1]]$not_present)) {
not_present <- (datalist[[1]]$not_present_type1 + datalist[[1]]$not_present_type2)
Expand All @@ -377,15 +379,17 @@ DAISIE_SR_loglik_CS <- DAISIE_SR_loglik_all <- function(
loglik <- loglik - logcond
if (length(datalist) > 1) {
for (i in 2:length(datalist)) {
loglik <- loglik + DAISIE_SR_loglik_CS_M1(
pars1 = pars1,
loglik <- loglik + DAISIE_loglik_CS_shift(
pars1 = pars1[1:10],
pars2 = pars2,
brts = datalist[[i]]$branching_times,
stac = datalist[[i]]$stac,
missnumspec = datalist[[i]]$missing_species,
methode = methode,
abstolint = abstolint,
reltolint = reltolint
reltolint = reltolint,
verbose = verbose,
tshift = pars1[11]
)
}
}
Expand Down
2 changes: 2 additions & 0 deletions R/DAISIE_loglik_CS.R
Original file line number Diff line number Diff line change
Expand Up @@ -1034,9 +1034,11 @@ DAISIE_loglik_CS <- DAISIE_loglik_all <- function(
reltolint = reltolint)
}
}

print_parameters_and_loglik(pars = pars,
loglik = loglik,
verbose = pars2[4],
parnames = c("lambda^c", "mu", "K", "gamma", "lambda^a", "prob_init_pres"),
type = 'island_loglik')
return(loglik)
}
Expand Down
Loading

0 comments on commit 2051f8e

Please sign in to comment.