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.
Context
policyengine-api-v2needs a 4.x-supported way to produce the legacy single-year macrowealth_decilesection. In the pre-1 API this was part ofSimulation.calculate_economy_comparison(). Inpolicyengine4.x, I found decile and intra-decile output helpers for income, but no first-class helper for the legacywealth_decilemacro result.This blocks the simulation API from moving to 4.x while preserving its public
SingleYearMacroOutputcontract.Proposed work
Add a 4.x output helper that computes the legacy
wealth_decileresult for supported countries, or document that the feature is intentionally unsupported and provide an equivalent replacement.Acceptance criteria
.pyoutput helper forwealth_decileusing the same public semantics as pre-1calculate_economy_comparison().