Context
policyengine-api-v2 needs a 4.x-supported way to produce the legacy single-year macro labor_supply_response section. Pre-1 Simulation.calculate_economy_comparison() returned this in the public macro output. In policyengine 4.x, country packages still contain labor-supply-response variables/parameters, but I did not find a first-class output helper that reconstructs the legacy response object.
This blocks the simulation API from migrating back to 4.x without changing the public SingleYearMacroOutput contract used by API/report callers.
Proposed work
Add a 4.x output helper that computes the legacy labor_supply_response result, including the aggregate fields and decile/hour breakdowns expected by existing callers.
Acceptance criteria
- Provide a
.py output helper for labor_supply_response or a documented replacement.
- Match the pre-1 output shape and sign conventions used by
calculate_economy_comparison().
- Cover US and UK behavior, including cases where response parameters are disabled or zero.
- Add tests for aggregate totals, decile breakdowns, and hours fields.
Context
policyengine-api-v2needs a 4.x-supported way to produce the legacy single-year macrolabor_supply_responsesection. Pre-1Simulation.calculate_economy_comparison()returned this in the public macro output. Inpolicyengine4.x, country packages still contain labor-supply-response variables/parameters, but I did not find a first-class output helper that reconstructs the legacy response object.This blocks the simulation API from migrating back to 4.x without changing the public
SingleYearMacroOutputcontract used by API/report callers.Proposed work
Add a 4.x output helper that computes the legacy
labor_supply_responseresult, including the aggregate fields and decile/hour breakdowns expected by existing callers.Acceptance criteria
.pyoutput helper forlabor_supply_responseor a documented replacement.calculate_economy_comparison().