Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci-fast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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"))
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion R/markers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
11 changes: 10 additions & 1 deletion tests/testthat/test-markers.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()))),
Expand Down
Loading