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
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
^INPUT\.md$
^CONTRIBUTING\.md$
^scripts$
^site$
^_site$
^study$
^output$
^references$
^OpenPVA\.png$
^\.github$
^\.vscode$
^.*\.Rcheck$
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and deploy documentation site

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Install OpenPVA and litedown
shell: Rscript {0}
run: |
install.packages("litedown")

- name: Build and install package with vignettes
run: |
R CMD build .
R CMD INSTALL --no-multiarch --with-keep.source OpenPVA_*.tar.gz
rm -f OpenPVA_*.tar.gz

- name: Build static site with litedown::pkg_site()
run: Rscript --vanilla scripts/build_site.R _site

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _site

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/output/
/_site/
.DS_Store
.Rhistory
.RData
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OpenPVA is a modern, open-R descendant of the GAPPS construction philosophy—bu
so conservation biologists (and their AI agents) can compose transparent,
inspectable, individual-based Population Viability Analyses in ordinary R.

## Core architecture (OpenPVA 2.2.0)
## Core architecture (OpenPVA 2.3.0)

- **One unified, pure-base-R engine:** `NeedsCompilation: no`, `Depends: R (>= 4.1.0)`,
and runtime `Imports` restricted to base/recommended packages (`codetools`,
Expand Down
6 changes: 3 additions & 3 deletions 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.2.0
Version: 2.3.0
Authors@R:
person("Barry W.", "Brook", email = "barry.brook@utas.edu.au",
role = c("aut", "cre", "cph"))
Expand All @@ -19,8 +19,8 @@ Description: An execution engine for individual-based population viability
report heterozygosity, allelic retention and founder representation.
Ensemble helpers separate structural and parametric designs from Monte
Carlo replicates and report viability summaries with Monte Carlo
standard errors, and base-graphics plot methods display trajectories,
risk and accounting.
standard errors, and base-graphics plot methods display lifecycle flow
diagrams, trajectories, risk, accounting and ensemble contrasts.
License: MIT + file LICENSE
Encoding: UTF-8
Depends: R (>= 4.1.0)
Expand Down
7 changes: 7 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
S3method("[",pva_ensemble)
S3method("[",pva_lifecycle)
S3method(plot,pva_ensemble)
S3method(plot,pva_lifecycle)
S3method(plot,pva_run)
S3method(plot,pva_scenario)
S3method(print,pva_ensemble)
S3method(print,pva_lifecycle)
S3method(print,pva_process)
S3method(print,pva_run)
S3method(print,pva_scenario)
Expand All @@ -15,11 +20,13 @@ export(catastrophe_process)
export(ceiling_density_multiplier)
export(ceiling_process)
export(census_process)
export(describe_lifecycle)
export(dispersal_process)
export(env_ar1)
export(env_trend)
export(environment_process)
export(execute_processes)
export(format_lifecycle)
export(genetic_metrics)
export(inbreeding_multiplier)
export(inbreeding_proxy_process)
Expand Down
29 changes: 29 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# OpenPVA news

## OpenPVA 2.3.0

- Visual lifecycle translation and inspection: `describe_lifecycle()` audits any
`pva_scenario`, `pva_run`, or process list into an ordered `pva_lifecycle`
data frame classifying ecological roles and inter-process data flows
(`same_interval` and `carryover`). `plot()` on a `pva_scenario` or
`pva_lifecycle` draws a pure-base-R node-and-edge lifecycle flow diagram
(single row up to 5 steps, two-row clockwise loop for 6+ steps).
`format_lifecycle()` exports plain-text summaries, Mermaid flowcharts, and
Graphviz DOT specifications without perturbing the RNG.
- Presentation, documentation, and site infrastructure: added the OpenPVA hex
logo (`man/figures/logo.png` / `scripts/logo.svg`), reproducible 3-panel
README hero graphic (`scripts/make_readme_hero.R`), refreshed `README.md`,
Zenodo Concept DOI in `inst/CITATION`, updated `docs/vision_and_scope.md`,
an agent-first modelling guide (`docs/for-agents.md`), a new visual workflow
vignette (`vignette("workflow", package = "OpenPVA")`), and a self-contained
`litedown::pkg_site()` documentation site (`site/`, `scripts/build_site.R`,
GitHub Pages workflow).
- Ergonomic fixes: `shift_logit()` now accepts empty `logical(0)` from `ifelse()`
when an extinct replicate hits `N == 0` while keeping strict validation on
non-empty inputs; `[.pva_ensemble` preserves provenance attributes across
data-frame subsetting; and `plot.pva_ensemble()` honours scalar or per-member
`col`.
- *Development provenance:* Developed iteratively in-house by Barry W. Brook
and Google Gemini 4 Neon (presentation, visual inspection, documentation,
and UX polish on top of the frozen `2.2.0` simulation core), with an
independent read-only cross-lab challenge audit by OpenAI Codex
(`gpt-6.2-astra`).

## OpenPVA 2.2.0

- Target removals, ceilings, translocations and individual treatments with
Expand Down
12 changes: 12 additions & 0 deletions R/ensemble.R
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,18 @@ summarise_accounting <- function(result) {
out
}

`[.pva_ensemble` <- function(x, ...) {
prov <- attr(x, "provenance")
out <- NextMethod("[")
if (is.data.frame(out) && !is.null(prov)) {
attr(out, "provenance") <- prov
if (!inherits(out, "pva_ensemble")) {
class(out) <- c("pva_ensemble", class(out))
}
}
out
}

print.pva_ensemble <- function(x, ...) {
prov <- attr(x, "provenance")
cat(sprintf("<pva_ensemble | rows: %d | runs/member: %s | root seed: %s>\n",
Expand Down
Loading
Loading