Skip to content

Update bboudata for bboutools 1.3.0#25

Open
sebdalgarno wants to merge 22 commits intomainfrom
extensions
Open

Update bboudata for bboutools 1.3.0#25
sebdalgarno wants to merge 22 commits intomainfrom
extensions

Conversation

@sebdalgarno
Copy link
Member

@sebdalgarno sebdalgarno commented Feb 27, 2026

Summary

Updates bboudata for bboutools 1.3.0 extensions (ECCC contract).

New datasets

  • bbousurv_multi / bbourecruit_multi — multi-population (A, B, C) with staggered year ranges, internal data gaps, and unobserved year placeholder rows
  • bbousurv_missing / bbourecruit_missing — single-population with unobserved year placeholder rows
  • bbousurv_annual — multi-population aggregate annual survival data

Updated validation

  • bbd_chk_data_survival() and bbd_chk_data_recruitment() gained multi_population and allow_missing arguments
  • Stricter all-or-nothing validation for placeholder rows when allow_missing = TRUE (all measurement columns must be NA, not just some)
  • Backwards compatible — default parameters preserve existing behavior

🤖 Generated with Claude Code

sebdalgarno and others added 14 commits November 13, 2025 09:06
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously the _missing datasets had 12 monthly rows with NA measurement
columns per unobserved year. The model expects one placeholder row per
year — the data pipeline uses these to set Annual factor levels, then
strips them before building the likelihood. Random effects for unobserved
years are estimated purely from the hierarchical prior.

Also simplifies validation: chk_whole_numeric and chk_gte pass with
all-NA values, so only chk_range, chk_not_any_na, and check_key need
to be gated by allow_missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wider staggering: ~35% latent year-population combos (was ~15%)
- Internal gaps: B missing 2008-2009 (surv) / 2009-2010 (recruit)
- Unobserved year placeholder rows: 2015 (surv) / 2016 (recruit)
- bbousurv_annual now multi-population (A + C, staggered years)
- Tests can filter to single pop or remove placeholders as needed
- Updated tests to use both multi_population and allow_missing flags

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sebdalgarno sebdalgarno changed the title Add multi-population, annual, and missing-value datasets Update bboudata for bboutools 1.3.0 Mar 12, 2026
@joethorley joethorley requested a review from Copilot March 12, 2026 14:47
Copy link
Member

@joethorley joethorley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - I have one minor question

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates bboudata to support bboutools 1.3.0 by adding new example datasets (including multi-population and missing-year placeholder patterns) and extending the survival/recruitment validation helpers to accept these new structures via opt-in flags.

Changes:

  • Added new datasets (bbousurv_multi, bbousurv_missing, bbousurv_annual, bbourecruit_multi, bbourecruit_missing) plus pkgdown/man documentation updates.
  • Extended bbd_chk_data_survival() / bbd_chk_data_recruitment() with multi_population and allow_missing arguments and new placeholder-row validation.
  • Added/updated test coverage for the new flags and placeholder-row behavior.

Reviewed changes

Copilot reviewed 20 out of 32 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
R/chk-data-survival.R Adds multi_population / allow_missing behavior to survival validation.
R/chk-data-recruitment.R Adds multi_population / allow_missing behavior to recruitment validation.
R/functions.R Updates internal validation helpers and adds placeholder-row helper.
tests/testthat/test-chk-data-survival.R Adds tests for multi-population and placeholder-row validation.
tests/testthat/test-chk-data-recruitment.R Adds tests for multi-population/missing datasets and placeholder-row validation.
data-raw/data-raw.R Builds the new datasets from raw spreadsheets.
data/*.rda Adds the new serialized datasets and re-saves existing ones.
R/bbousurv.R, R/bbourecruit.R Adds roxygen dataset documentation blocks for new datasets.
man/*.Rd Adds generated documentation for new datasets and updated function docs.
_pkgdown.yml Adds new datasets to the reference index.
DESCRIPTION Bumps package version and updates metadata.
NEWS.md Adds a new release section describing the updates.
.gitignore, .Rbuildignore Ignores Claude-related artifacts.
R/licensing.R Removes an @examples tag from an internal helper doc block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sebdalgarno
Copy link
Member Author

I've implemented the changes suggested by copilot

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sebdalgarno
Copy link
Member Author

Updated licensing: added Copyright 2025 Environment and Climate Change Canada to all modified files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants