diff --git a/.github/workflows/ci-fast.yaml b/.github/workflows/ci-fast.yaml index 2cf3b0f..379031e 100644 --- a/.github/workflows/ci-fast.yaml +++ b/.github/workflows/ci-fast.yaml @@ -20,6 +20,8 @@ jobs: - os: ubuntu-24.04 r: release manual: true + - os: ubuntu-24.04 + r: devel - os: ubuntu-24.04 r: '4.1.0' defaults: diff --git a/DESCRIPTION b/DESCRIPTION index b2d7aa9..825f420 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: OpenPVA Title: Composable Individual-Based Population Viability Analysis -Version: 2.1.0 +Version: 2.1.1 Authors@R: person("Barry W.", "Brook", email = "barry.brook@utas.edu.au", role = c("aut", "cre", "cph")) diff --git a/NEWS.md b/NEWS.md index 3221dd0..8b8f221 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,14 @@ # OpenPVA news +## OpenPVA 2.1.1 + +- Accept R-devel (`R >= 4.7.0`) `.Random.seed` headers incorporating + `binom.kind` (and any future L'Ecuyer-CMRG header extensions satisfying + `seed[1L] >= 7L && seed[1L] %% 100L == 7L`) in neutral-locus marker-stream + validation. +- Link `README.md` design documents via canonical GitHub URLs so CRAN tarball + checks encounter no missing relative file URIs. + ## OpenPVA 2.1.0 - Kinship-aware mating. `mate_min_kinship()` gives each female the least diff --git a/R/markers.R b/R/markers.R index c6f951e..90149fe 100644 --- a/R/markers.R +++ b/R/markers.R @@ -136,7 +136,7 @@ .valid_marker_seed <- function(seed) { if (!is.integer(seed) || !is.null(dim(seed)) || length(seed) != 7L || - !seed[1L] %in% c(7L + (0:5) * 100L, 10007L + (0:5) * 100L)) return(FALSE) + is.na(seed[1L]) || seed[1L] < 7L || seed[1L] %% 100L != 7L) return(FALSE) # R stores the unsigned words as signed integers, including the NA bit pattern. words <- as.double(seed[-1L]) words[is.na(words)] <- 2^31 diff --git a/README.md b/README.md index 8844117..955d6eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # OpenPVA -OpenPVA 2.1.0 is a modular, individual-based engine for population viability +OpenPVA 2.1.1 is a modular, individual-based engine for population viability analysis in R. A model specifies a population, the order of biological processes within each interval, and the census that defines the risk endpoint. Processes declare the fields they read, write and create. The engine assigns individual @@ -159,8 +159,8 @@ section from the functions' formals, so `roxygen2` is not required. ## Design documents -- [Vision and scope](docs/vision_and_scope.md) -- [Lifecycle-process contract](docs/design/lifecycle_process_contract.md) -- [Public API](docs/reference/public_api.md) -- [GAPPS heritage](docs/gapps_heritage.md) and - [evidence review](docs/literature/gapps_evidence_review.md) +- [Vision and scope](https://github.com/BWBrook/OpenPVA/blob/main/docs/vision_and_scope.md) +- [Lifecycle-process contract](https://github.com/BWBrook/OpenPVA/blob/main/docs/design/lifecycle_process_contract.md) +- [Public API](https://github.com/BWBrook/OpenPVA/blob/main/docs/reference/public_api.md) +- [GAPPS heritage](https://github.com/BWBrook/OpenPVA/blob/main/docs/gapps_heritage.md) and + [evidence review](https://github.com/BWBrook/OpenPVA/blob/main/docs/literature/gapps_evidence_review.md) diff --git a/tests/testthat/test-markers.R b/tests/testthat/test-markers.R index 6a6aaff..f718f04 100644 --- a/tests/testthat/test-markers.R +++ b/tests/testthat/test-markers.R @@ -364,12 +364,21 @@ test_that("genotypes are engine-owned and genetic censuses survive extinction", expect_error(execute_processes(broken, list(census_process())), "neutral-locus store") expect_error(marker_founder_shares(broken), "neutral-locus store") invalid <- list(source = rev(state$markers$source), id = c(1L, 1L), - n_native = 5L, seed = 1:7, seed = c(10407L, 0L, 0L, 0L, 1L, 2L, 3L)) + n_native = 5L, seed = 1:7, + seed = c(NA_integer_, 1L, 2L, 3L, 4L, 5L, 6L), + seed = c(-93L, 1L, 2L, 3L, 4L, 5L, 6L), + seed = c(10407L, 0L, 0L, 0L, 1L, 2L, 3L)) for (i in seq_along(invalid)) { broken <- state broken$markers[[names(invalid)[i]]] <- invalid[[i]] expect_error(execute_processes(broken, list(census_process())), "neutral-locus store") } + r_devel_header <- state + r_devel_header$markers$seed[1L] <- 1010407L + expect_identical( + summarise_markers(execute_processes(r_devel_header, list(census_process()))$state), + summarise_markers(state) + ) expect_output(print(state), "neutral loci: 2") expect_error( execute_processes(pva_state(adult_population()), list(census_process(genetic_metrics()))),