Skip to content

Add 4.x output support for legacy wealth_decile macro result #353

@anth-volk

Description

@anth-volk

Context

policyengine-api-v2 needs a 4.x-supported way to produce the legacy single-year macro wealth_decile section. In the pre-1 API this was part of Simulation.calculate_economy_comparison(). In policyengine 4.x, I found decile and intra-decile output helpers for income, but no first-class helper for the legacy wealth_decile macro result.

This blocks the simulation API from moving to 4.x while preserving its public SingleYearMacroOutput contract.

Proposed work

Add a 4.x output helper that computes the legacy wealth_decile result for supported countries, or document that the feature is intentionally unsupported and provide an equivalent replacement.

Acceptance criteria

  • Provide a .py output helper for wealth_decile using the same public semantics as pre-1 calculate_economy_comparison().
  • Cover country-specific behavior, including where wealth deciles are unavailable.
  • Add tests against a small fixture or deterministic simulation output.
  • Document the expected output shape so API adapters do not need to duplicate country-specific logic.

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