Skip to content

Add 4.x output support for legacy intra_wealth_decile macro result #354

@anth-volk

Description

@anth-volk

Context

policyengine-api-v2 needs a 4.x-supported way to produce the legacy single-year macro intra_wealth_decile section. Pre-1 Simulation.calculate_economy_comparison() produced this as part of the macro output. In policyengine 4.x, there is an IntraDecileImpact helper for income deciles, but I did not find a first-class helper for the legacy wealth-decile version.

This blocks a safe migration to 4.x while preserving the simulation API's public SingleYearMacroOutput contract.

Proposed work

Add a 4.x output helper for intra-wealth-decile impacts, using the same categories and semantics as the pre-1 macro output where possible.

Acceptance criteria

  • Provide a .py output helper for intra_wealth_decile or a documented replacement.
  • Preserve the legacy category semantics and output shape expected by API/report callers.
  • Handle unsupported countries or missing wealth-decile variables explicitly.
  • Add tests for normal output and unsupported/missing-data cases.

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