Skip to content

Add 4.x output support for legacy labor_supply_response macro result #355

@anth-volk

Description

@anth-volk

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.

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