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
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_typefield onPovertyoutput classis_maleadded to UK and US personentity_variables(for gender poverty)raceadded to US personentity_variables(for racial poverty)household_state_income_taxadded to US tax_unitentity_variables(for state tax budget line)household_income_decileandhousehold_count_peopleadded to UK and US householdentity_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