Skip to content

Add entity variables and convenience functions for V1 economy output parity #233

@anth-volk

Description

@anth-volk

Context

Phase 2 of the simulation/report V2 migration requires the API to compute all economy-wide outputs that V1 currently returns (poverty by demographics, inequality, budget summary, intra-decile impacts). The computation library (policyengine.py) needs additional entity variables surfaced in the simulation output and convenience functions to support these.

Changes needed

Entity variable additions

  • poverty_type field on Poverty output class
  • is_male added to UK and US person entity_variables (for gender poverty)
  • race added to US person entity_variables (for racial poverty)
  • household_state_income_tax added to US tax_unit entity_variables (for state tax budget line)
  • household_income_decile and household_count_people added to UK and US household entity_variables (for intra-decile computation)

Convenience functions

  • calculate_us_poverty_by_age() / calculate_uk_poverty_by_age()
  • calculate_us_poverty_by_gender() / calculate_uk_poverty_by_gender()
  • calculate_us_poverty_by_race() (US only)

Target branch

app-v2-migration

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