From f1ed15d8f7597623a250d20b9b0440012d150b25 Mon Sep 17 00:00:00 2001 From: Doug Manuel Date: Thu, 17 Sep 2026 20:20:25 -0400 Subject: [PATCH 1/2] Prepare v0.5.0 release: version, NEWS structure, README status, cran-comments Bump Version to 0.5.0. Promote the NEWS development section to a 0.5.0 heading and restructure it the way 0.4.0 was: breaking changes first (the #38 seed-contract change, now with an explicit migrating paragraph telling users to regenerate pinned expected values once), then new features (#39 formula variables, n = 0, native exponential), then validation and error-message changes. No entry text was dropped. README: version badge and status line to 0.5.0; the intro records that 0.5 adds formula-derived variables and the seed contract; the deferred- ideas list no longer names formula variables (they landed) and names Func:: dispatch instead. cran-comments: refresh the local-check record (simstudy now installed so the Suggests note is gone; 2 notes remain) and mention the new CI check. --- DESCRIPTION | 2 +- NEWS.md | 44 ++++++++++++++++++++++++++------------------ README.md | 19 ++++++++++--------- cran-comments.md | 18 ++++++++++-------- 4 files changed, 47 insertions(+), 36 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 596ab22..4177b06 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: MockData Title: Generate Mock Data from Metadata Specifications -Version: 0.4.0 +Version: 0.5.0 Authors@R: c( person("Juan", "Li", role = "aut", email = "juli@ohri.ca"), person("Douglas", "Manuel", role = c("aut", "cre"), email = "dmanuel@ohri.ca"), diff --git a/NEWS.md b/NEWS.md index ba45634..6e25d51 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,17 +1,6 @@ -# MockData (development version) +# MockData 0.5.0 -## Formula-derived variables (#39, Phase A) - -- Variables can now be generated from algebraic expressions over other - generated variables via a new `mockFormula` column in `variable_details` - (e.g. `weight / (height^2)`), or the new `mock_formula()` direct API. - Formulas are evaluated in dependency order by `evaluate_mock_formulas()`, - in a restricted environment exposing only the generated columns and a - fixed allow-list of base functions. `DerivedVar::`/`Func::` semantics are - unchanged: derived variables without a `mockFormula` remain excluded from - generation, and `Func::` dispatch is not yet supported. - -## Reproducibility (breaking change) +## Breaking changes - Seeded output changed once for the RNG-stream mechanism in this release. Within the `create_mock_data()` pipeline (`generate_mock_data_native()`, @@ -26,16 +15,30 @@ still seed a single Mersenne-Twister stream per call. For a given seed **and package version** pipeline output is reproducible and independent of the session's ambient `RNGkind()`; it is not comparable across the v0.4 → - v0.5 boundary. Pin your own expected values against the version you use. - For seeded calls, generation no longer alters the caller's RNG state - (previously the legacy `validate = FALSE` path reset it). + v0.5 boundary. For seeded calls, generation no longer alters the caller's + RNG state (previously the legacy `validate = FALSE` path reset it). (#38) + + **Migrating:** if your tests pin values from seeded v0.4 runs of + `create_mock_data()` or the `mock_spec` pipeline, regenerate those expected + values once under v0.5 and pin them again. The same seed keeps giving + identical output within this version. Standalone `create_*` calls need no + change. + +## New features +- Formula-derived variables (#39, Phase A). Variables can now be generated + from algebraic expressions over other generated variables via a new + `mockFormula` column in `variable_details` (e.g. `weight / (height^2)`), + or the new `mock_formula()` direct API. Formulas are evaluated in + dependency order by `evaluate_mock_formulas()`, in a restricted environment + exposing only the generated columns and a fixed allow-list of base + functions. `DerivedVar::`/`Func::` semantics are unchanged: derived + variables without a `mockFormula` remain excluded from generation, and + `Func::` dispatch is not yet supported. - `create_mock_data()` now accepts `n = 0`, returning a zero-row data frame with the full generated schema (useful for schema tests), and rejects fractional, negative, `NA`, and non-finite values of `n` with a clear message. The validation now matches `generate_mock_data_native()`. -- Calling `create_mock_data()` without `databaseStart` now fails upfront with - a message naming the argument, instead of a raw missing-argument error. - The native backend now supports `distribution = "exponential"` (parity with the legacy generator), removing a forced legacy-fallback for exponential metadata. When the optional simstudy backend is selected, exponential @@ -44,6 +47,11 @@ their generation. Native exponential values are truncated to the declared `range` by inverse-CDF sampling, rather than clipped at the range maximum (with a point mass at the boundary) as the legacy `rexp()` path does. + +## Validation and error messages + +- Calling `create_mock_data()` without `databaseStart` now fails upfront with + a message naming the argument, instead of a raw missing-argument error. - With `validate = TRUE` (the default), invalid distribution parameters in metadata — e.g. `distribution = "exponential"` without a positive `rate` — now stop generation with a message naming the variable and how to fix it, diff --git a/README.md b/README.md index f71d571..5fa5778 100644 --- a/README.md +++ b/README.md @@ -3,19 +3,20 @@ [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental) -[![Version: 0.4.0](https://img.shields.io/badge/version-0.4.0-blue.svg)](https://github.com/Big-Life-Lab/MockData) +[![Version: 0.5.0](https://img.shields.io/badge/version-0.5.0-blue.svg)](https://github.com/Big-Life-Lab/MockData) [![pkgdown](https://github.com/Big-Life-Lab/MockData/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/Big-Life-Lab/MockData/actions/workflows/pkgdown.yaml) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -**Status: Experimental v0.4.0 release** +**Status: Experimental v0.5.0 release** MockData is a work-in-progress R package for generating mock testing data from -small metadata specifications. Version 0.4 introduces the +small metadata specifications. Version 0.4 introduced the `mock_spec` architecture: direct specification helpers, a recodeflow metadata adapter, native generation, optional `simstudy` generation, and post-processing -diagnostics. It is useful today for development and documentation workflows, +diagnostics. Version 0.5 adds formula-derived variables (`mockFormula`) and a +per-stage seed contract. It is useful today for development and documentation workflows, especially when paired with recodeflow-style metadata (see below), but it should be treated as experimental infrastructure rather than a stable released package. @@ -23,14 +24,14 @@ People are using MockData and reporting that it is helpful. We take that as an encouraging signal, not as evidence that the package is mature. Please review the generated data before using it in any workflow that matters. -v0.4 keeps the existing v0.3 public functions available. Several -larger ideas were deliberately deferred rather than rushed into this release: -formula-derived variables, multi-variable correlation, Table 1 bootstrap, -LinkML/schema-first integration, and advanced survival simulation. MockData +v0.5 keeps the existing v0.3 public functions available. Several +larger ideas remain deliberately deferred rather than rushed into a release: +`Func::` dispatch for derived variables, multi-variable correlation, Table 1 +bootstrap, LinkML/schema-first integration, and advanced survival simulation. MockData also remains framed as mock data for development and QA, not synthetic data for privacy release or inference. -Please try v0.4 with representative `variables.csv` and +Please try v0.5 with representative `variables.csv` and `variable_details.csv` files and report bugs, surprising output, confusing diagnostics, or migration issues in [GitHub Issues](https://github.com/Big-Life-Lab/MockData/issues). Broader design diff --git a/cran-comments.md b/cran-comments.md index 6e74b6a..81de8d9 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -5,29 +5,31 @@ Checked with: - R 4.4.2 -- macOS 26.5, aarch64-apple-darwin20 -- `R CMD check --as-cran --no-manual` +- macOS 26.0, aarch64-apple-darwin20 +- `R CMD check --as-cran --no-manual` on the built tarball +- Suggests installed, including `simstudy` 0.9.2, so the optional backend's + tests ran rather than skipped Result: - 0 errors - 0 warnings -- 3 notes +- 2 notes Notes: - New submission. -- `simstudy` was not installed in the local check environment, so the local - check used `_R_CHECK_FORCE_SUGGESTS_=false`. `simstudy` is listed in - `Suggests` and is used only for the optional backend. - The local check reported `unable to verify current time`. +Continuous integration runs the same check on Ubuntu (`R-CMD-check` +workflow) for every push to `main`/`dev` and every pull request into them. + ## Release notes This is the first CRAN submission of MockData. The package generates mock testing data from metadata specifications supplied as data frames or CSV files. -It supports categorical, continuous, date, garbage-data, and survival-style -variables for testing data pipelines and documentation examples. +It supports categorical, continuous, date, garbage-data, formula-derived, and +survival-style variables for testing data pipelines and documentation examples. MockData generates mock data for software testing and workflow validation. It does not generate privacy-preserving synthetic data for inference or data From 0a6ddf4858135b88faee76a27feed7afb62f73ce Mon Sep 17 00:00:00 2001 From: Doug Manuel Date: Sun, 27 Sep 2026 07:38:06 -0400 Subject: [PATCH 2/2] Record v0.5 release assembly as complete in the post-v0.4.0 plan Ticks the four Task 8 items with how each was met: #38, #39 and #40 ship together with one migrating paragraph; pinned seed tests in test-seed-contract.R; R CMD check --as-cran clean on the 0.5.0 tarball and pkgdown builds; version 0.5.0, with the extension columns documented in MockData rather than in a separate downstream notice (maintainer decision, 2026-09-22). --- development/post-v040-development-plan.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/development/post-v040-development-plan.md b/development/post-v040-development-plan.md index d8ade5f..c60d902 100644 --- a/development/post-v040-development-plan.md +++ b/development/post-v040-development-plan.md @@ -573,10 +573,10 @@ Tasks 5 and 6 **must land in the same minor release**: both change seeded output ### Task 8: v0.5 release assembly -- [ ] Tasks 5 + 6 merged together; one NEWS migration section covering the seeded-output break with before/after guidance. -- [ ] Pinned-value seed regression tests in place (#22 closed). -- [ ] `devtools::check()` clean; `roxygen2::roxygenize()` then `pkgdown::build_site()` clean; `renv::snapshot()` if dependencies moved. -- [ ] Version bump to 0.5.0; downstream heads-up to cchsflow/chmsflow maintainers if any metadata-extension columns were added. +- [x] Tasks 5 + 6 merged together; one NEWS migration section covering the seeded-output break with before/after guidance. (#38, #39 and #40 all ship in 0.5.0; NEWS "Breaking changes" carries the migrating paragraph.) +- [x] Pinned-value seed regression tests in place (#22 closed). (`tests/testthat/test-seed-contract.R`; #22 closed by the release PR.) +- [x] `devtools::check()` clean; `roxygen2::roxygenize()` then `pkgdown::build_site()` clean; `renv::snapshot()` if dependencies moved. (2026-09-27: `R CMD check --as-cran` on the 0.5.0 tarball, 0 errors, 0 warnings, 3 documented notes; `devtools::check()` is blocked by the local toolchain. pkgdown builds; the lockfile was updated in #51.) +- [x] Version bump to 0.5.0; downstream heads-up to cchsflow/chmsflow maintainers if any metadata-extension columns were added. (Maintainer decision 2026-09-22: the extension columns `mockFormula`, `anchor` and `censored_by` are documented in MockData, in `reference-config.qmd`'s placement rule, rather than in a separate notice. They are optional and change nothing for those packages.) ---