Skip to content

Preserve reform-baseline subsampling regression coverage - #606

Merged
MaxGhenis merged 2 commits into
masterfrom
hub-subsample-reform-baseline-tests-1010
Oct 10, 2026
Merged

MaxGhenis merged 2 commits into
masterfrom
hub-subsample-reform-baseline-tests-1010

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Preserve the reform-baseline subsampling regression coverage from #601 after #573 supplied the production fixes on master. This draft ports only the missing tests and the required changelog fragment; no production code changes.

The examples cover parametric and structural reform results calculated before subsampling, a changed default read without a period input, an override deleted before a reform calculation, and dataset overrides of formula-backed variables preserved in both arms. The deleted-input test drops its obsolete stale-registry assertion and describes the behavior master implements.

The Hypothesis property uses master's recorded-input export and varied populations, weights, formula overrides, reforms, sample sizes, seeds, and combined calculation histories on either arm. It checks export stability, history-independent rebuilding/results, baseline fidelity against an independently subsampled unreformed simulation, and preservation of each retained person's original values. An explicit mixed reform/baseline history example exercises both arms together.

The incompatible structural-ID freezing test and already-merged input-only tests are excluded. #601 remains open for the hub to handle.

Validation against unchanged master production code:

  • uv run pytest -q tests/core/test_subsample_computed_values.py — 7 passed (four reform-result cases, changed default, deleted override, and dataset override in both arms).
  • uv run pytest -q tests/core/test_subsample_computed_values_property.py — 1 passed (configured for 200 generated examples plus six explicit examples).
  • Scoped Ruff format and lint on both new modules — passed.
  • git diff --check — passed.

All ported tests pass with production code unchanged from master at 42556d5dff8cde292b657cd1426b5e1351e4c5c8. No defects found and no xfails added.

Full suites and microsimulations were not run, per the hub's single-file validation scope. Documentation changes are not required for tests and a changelog fragment.

@MaxGhenis
MaxGhenis marked this pull request as ready for review October 10, 2026 18:57
@MaxGhenis
MaxGhenis merged commit ee84119 into master Oct 10, 2026
19 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

US + core hub merge audit, core#606 at 6b52174cacea079ffcd7ce7aa2baab18d2a1ef49 (squash): regression tests for subsampling a reform simulation after calculating (salvaged from #601).

@MaxGhenis
MaxGhenis deleted the hub-subsample-reform-baseline-tests-1010 branch October 10, 2026 18:57
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.

1 participant