Skip to content

Enforce PUF-clone weight-share floor in the dataset upload validator #1158

@MaxGhenis

Description

@MaxGhenis

Summary

The tax-unit construction engine and its rule helpers have been extracted into the standalone, reusable microunit package. This repository should depend on microunit for tax-unit construction rather than keeping its own in-repo copy, so the rules have a single canonical home and can be shared across PolicyEngine's microdata stack.

Current state

Tax-unit construction currently lives in:

  • policyengine_us_data/datasets/cps/tax_unit_construction.py — the engine (construct_tax_units, modes, filing-status logic).
  • policyengine_us_data/datasets/cps/tax_unit_rule_helpers.py — the federal rule helpers (CPS relationship codes, qualifying-child age test, qualifying-relative gross-income limit, etc.).

microunit was extracted from these modules: the engine logic (everything from the HEAD = "HEAD" marker onward) is byte-identical, and microunit exposes the same public API and the same construct_tax_units(person, year, mode="policyengine") -> (person_assignments, tax_unit) signature.

Proposed change

  • Add microunit as a dependency.
  • Delete the two in-repo modules.
  • Re-point every call site (census_cps.py, the ACS wrapper, the two validation/ scripts, and the tests) to import from microunit.
  • Keep policyengine_us_data/datasets/acs/acs_to_cps_columns.py and the thin ACS wrapper in this repo, since microunit deliberately excludes ACS column mapping.

This is behavior-preserving: tax-unit output is unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions