Skip to content

Household calculations and household reports apply a dynamic, and every simulation refuses another country's dynamic #1112

Open

Description

@anth-volk

Household jobs and household reports always store dynamic_id as null, so a household calculation can't apply model assumptions: labour-supply elasticities, net-income definitions and the other parameters under gov.simulation. Economy simulations already apply them, by merging the dynamic's values into the policy's (combine_reforms).

API v1's revision 9d1d12a7ac58 (PolicyEngine/policyengine-api#4325, merged as 003ee4996) gives every dynamic a country. Sim's model of dynamics declares only id, so sim can't refuse a dynamic stored for another country. Its test helper insert_dynamic still writes dynamics.name, which that revision drops.

Done when:

  • POST /household-calculations takes a dynamic_id, stores it in household_jobs.dynamic_id, returns it in the job's state, and applies its values with the policy's.
  • Each side of a household report, and of its re-run, takes a dynamic_id. The side's simulation stores it, its key names it, and its values are applied with the side's policy.
  • Every simulation, economy and household alike, refuses a dynamic stored for another country as unknown_dynamic.
  • libs/policyengine-simulation-persistence/public-api-commit names 003ee49965a2190e0e5c78f7e946b4bb100c0f16, and the comparison with API v1's tables passes there.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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