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.
Context
policyengine-api-v2needs a 4.x-supported way to produce the legacy single-year macrointra_wealth_decilesection. Pre-1Simulation.calculate_economy_comparison()produced this as part of the macro output. Inpolicyengine4.x, there is anIntraDecileImpacthelper 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
SingleYearMacroOutputcontract.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
.pyoutput helper forintra_wealth_decileor a documented replacement.