Skip to content

Offer household years separately from society-wide years in the country metadata #4160

Closed

Description

@anth-volk

Why

The /{country}/metadata response has one year list, economy_options.time_period, and the app reads it for every year menu: household reports, society-wide reports and the policy editors.

The plan is for the Public API to refuse society-wide (population-wide) US runs for 2022 and 2023, because the data for those years is nearly empty, while still allowing household calculations for those years. With a single year list, narrowing the society-wide years would also remove 2022 and 2023 from household reports. Household years and society-wide years therefore need separate lists in the metadata.

What #4159 adds

#4159 adds household_options.time_period to the /{country}/metadata response, with items in the same shape as economy_options.time_period items ({"name": <int year>, "label": "<year>"}). It leaves economy_options unchanged.

  • US: the years the bundle's certified SPM forecast covers, up to the last year in the CPI-U parameter's source file (gov.bls.cpi.cpi_u), newest first. With the current bundle this is 2035 to 2022. Without a certified SPM forecast, the US household years are the US society-wide years.
  • UK: the rule for the UK society-wide years (uk_economy_years), currently 2024 to 2032.
  • Any other country: its society-wide years.

Building the list loads no dataset and runs no simulation, so it adds no meaningful startup time.

Later

PolicyEngine/policyengine-app-v2#1515 makes the app read household_options.time_period for household year menus and the policy editors, and economy_options.time_period for society-wide ones. After that is deployed, a later Public API PR will narrow the US economy_options.time_period to start at 2024 and refuse society-wide requests for years outside it.

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