Skip to content

Determine whether pre-1 detailed_budget maps to ProgramStatistics #352

@anth-volk

Description

@anth-volk

Context

policyengine-api-v2 needs to preserve the legacy single-year macro output shape when it eventually moves back to policyengine 4.x. The pre-1 Simulation.calculate_economy_comparison() result included detailed_budget, while the 4.x economic_impact_analysis() path exposes program_statistics.

Before the simulation API can safely adapt 4.x outputs back into the legacy response contract, we need to determine whether detailed_budget can be reconstructed from ProgramStatistics without semantic drift.

Questions to answer

  • Does every pre-1 detailed_budget entry have a corresponding ProgramStatistics row for US and UK?
  • Are signs, baseline/reform totals, changes, and recipient/count fields equivalent?
  • Are labels/groupings in the old detailed_budget public contract recoverable from 4.x metadata?
  • Are any old detailed_budget fields intentionally unsupported in 4.x?

Acceptance criteria

  • Document the mapping from pre-1 detailed_budget to 4.x ProgramStatistics for US and UK.
  • Identify any unmappable fields or sign convention differences.
  • Add tests or fixtures that compare representative pre-1 and 4.x outputs if feasible.
  • Recommend whether the sim API should reconstruct detailed_budget from ProgramStatistics or expose a new dedicated .py output helper.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions