Repository navigation
Extract the population-view harness from imputation-paper (#1) - #3
Merged
Merged
Conversation
Behavior-preserving extraction of the population-view harness into the standalone popdgp package: - popdgp.metrics: energy_distance, prdc, classifier_two_sample_auc, weighted_wasserstein1, reweight_fragility, plus the private weighted reductions the view's tail block depends on. Metric definitions, caps, and defaults are copied verbatim from the paper's experiments/metrics.py (guardian-owned semantics). The task-only marginal metrics (weighted_pinball_loss, zero_share_error) stay in the paper repo. - popdgp.views: SurveyView, project_view, score_view, harness_scorecard, identical to experiments/views.py apart from the metrics import. - popdgp.floors: split_frame/Split (from the paper's holdout.py) plus sample_reference_scorecard, a generator-agnostic form of the harness's scf_sample_reference sampling-noise floor. Packaging per the sibling repos: uv + hatchling, ruff, pytest, and a CI workflow (test matrix 3.11-3.13, ruff, and a build/twine-check step for PyPI release prep). Does not modify imputation-paper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Resume spec: #1. Diff against origin/main for state; work is incomplete and unreviewed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… state Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
29/29 tests pass (parity ran against sibling paper checkout, bit-identical); ruff check + format --check clean; uv build + twine check pass. Mirrors CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
paper.md: sole author Max Ghenis (ORCID 0000-0002-1335-8277), with TODO(authorship) markers for pending author-list alignment and no presumed co-authors. Canonical citations for energy distance (Szekely & Rizzo 2013), PRDC (Naeem et al. 2020), C2ST (Lopez-Paz & Oquab 2017), and Wasserstein (Ramdas et al. 2017); factual claims only, cross-checked against the source. LICENSE: MIT, materializing the license already declared in pyproject (JOSS requires an OSI license file); now packaged into the sdist and wheel. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts the population-view harness from
imputation-paper into this
package, behavior-preserving, and prepares it for a PyPI release and a JOSS
software note. Closes #1.
The package is evaluation-only and generator-agnostic: it scores any candidate
weighted population file against the surveys that observe it, and takes no
dependency on populace or any other generator. Public surface, per the issue:
popdgp.views—SurveyView,project_view,score_view,harness_scorecard(the projection-and-score harness that emits a per-viewscorecard).
popdgp.metrics— the weighted joint/tail/stress metrics:energy_distance,prdc,classifier_two_sample_auc,weighted_wasserstein1,reweight_fragility.popdgp.floors—split_frame,sample_reference_scorecard(a survey's owncomplementary split, scored as a candidate, anchoring every axis).
Per the issue's division of labor, the marginal task metrics (pinball loss,
zero-share error) stay in the paper repo;
weighted_wasserstein1comes across(the tail block needs it) and
reweight_fragilitycomes across (it is aproperty of any weighted file, not of a task).
Behavior preservation
Fidelity is enforced by
tests/test_parity.py, which imports theimputation-paper originals when their source is available (a sibling checkout or
IMPUTATION_PAPER_SRC) and asserts the extracted functions reproduce them tonumerical equality on shared fixtures and seeds — including the private weighted
reductions the tail block reaches into,
score_viewwith its tail block, andthe full
harness_scorecard. When the source is absent the module skipscleanly, so it never passes vacuously. Run locally against the sibling checkout,
all parity tests pass (they are exact-equality assertions, not tolerances).
Local verification (mirrors CI)
pytest: 29 passed (floors 6, metrics 10, parity 9, views 4) on Python3.13; the 9 parity tests ran against the sibling
imputation-papercheckout.ruff check .andruff format --check .: clean.uv build+uvx twine check dist/*: sdist and wheel build, both PASS.JOSS note
Adds
paper.md+paper.bib(the JOSS submission). Citations are the canonicalreferences for each metric — energy distance (Székely & Rizzo 2013), the
PRDC family (Naeem et al. 2020), the classifier two-sample test (Lopez-Paz &
Oquab 2017), and Wasserstein two-sample testing (Ramdas et al. 2017) — and the
prose makes factual claims only, cross-checked against the implementation.
The author block lists Max Ghenis as sole author with a
TODO(authorship)marker: the harness originated in imputation-paper, so the final author list
and order should be confirmed before submission. No co-authors are presumed.
LICENSE
Adds an MIT
LICENSEfile, materializing thelicense = { text = "MIT" }already declared in
pyproject.toml(JOSS requires an OSI-approved license fileand the repo had none). It is now packaged into the sdist and wheel. Note for
review: PolicyEngine's core packages (e.g. policyengine.py) are AGPL-3.0; MIT
here follows the committed pyproject declaration rather than a new choice — flag
if a different license is intended.
Not in scope (deliberately)
switching to a pinned
popdgpand regenerating bit-identical tables — is afollow-up, guarded here by the parity suite.
🤖 Generated with Claude Code