diff --git a/changelog.d/us-2036-economy-year.added.md b/changelog.d/us-2036-economy-year.added.md new file mode 100644 index 000000000..10b719aba --- /dev/null +++ b/changelog.d/us-2036-economy-year.added.md @@ -0,0 +1 @@ +Offer 2036 as a US economy and household year, for the PolicyEngine bundle whose SPM forecast covers 2022–2036. diff --git a/docs/canonical-spm.md b/docs/canonical-spm.md index 30608e013..26b58d8f2 100644 --- a/docs/canonical-spm.md +++ b/docs/canonical-spm.md @@ -77,7 +77,7 @@ The `spm` object accepts only these fields: Unknown fields and invalid selections are rejected. Only the household's `county_fips` input identifies a local county. Computed county, state, first county in state and congressional district do not identify an SPM area. The full -canonical artifact supplies 2022–2035 measurements; no consumer CPI extrapolation +canonical artifact supplies 2022–2036 measurements; no consumer CPI extrapolation or congressional-district geographic factors are introduced. `POST /us/calculate` and `/us/calculate-full` take settings beside the existing diff --git a/policyengine_api/country.py b/policyengine_api/country.py index 8c04362b4..f5c0c2e40 100644 --- a/policyengine_api/country.py +++ b/policyengine_api/country.py @@ -301,6 +301,7 @@ def build_microsimulation_options(self) -> dict: # Add all 436 congressional districts (435 voting + DC) region.extend(build_congressional_district_metadata()) time_period = [ + {"name": 2036, "label": "2036"}, {"name": 2035, "label": "2035"}, {"name": 2034, "label": "2034"}, {"name": 2033, "label": "2033"}, diff --git a/policyengine_api/data/v2/catalog/extraction.py b/policyengine_api/data/v2/catalog/extraction.py index 75b0b213f..6df359eae 100644 --- a/policyengine_api/data/v2/catalog/extraction.py +++ b/policyengine_api/data/v2/catalog/extraction.py @@ -43,7 +43,7 @@ } CURRENT_LAW_IDS = {"us": 2, "uk": 1} METADATA_TIME_PERIODS = { - "us": tuple(range(2035, 2021, -1)), + "us": tuple(range(2036, 2021, -1)), "uk": tuple(range(2024, 2031)), } SUPPORTED_REGION_TYPES = frozenset( diff --git a/tests/unit/test_country_spm.py b/tests/unit/test_country_spm.py index fbbb0f868..60c0e9faf 100644 --- a/tests/unit/test_country_spm.py +++ b/tests/unit/test_country_spm.py @@ -609,7 +609,7 @@ def selection_for_geography(geography): @pytest.mark.parametrize("geography", ["national", "metro"]) -@pytest.mark.parametrize("year", [2021, 2036]) +@pytest.mark.parametrize("year", [2021, 2037]) def test_real_http_tax_only_outside_artifact_years_is_lazy( real_http_client, geography, year ): @@ -637,9 +637,9 @@ def test_real_http_tax_only_outside_artifact_years_is_lazy( def test_real_http_unsupported_spm_year_is_structured_only_when_calculated( real_http_client, geography, variable, axes ): - household = household_in_year(variable, 2036, axes=axes) + household = household_in_year(variable, 2037, axes=axes) if variable == "spm_unit_net_income": - household["spm_units"]["spm_unit"]["housing_assistance"] = {"2036": 1_000} + household["spm_units"]["spm_unit"]["housing_assistance"] = {"2037": 1_000} response = real_http_client.post( "/us/calculate", json={ @@ -651,7 +651,7 @@ def test_real_http_unsupported_spm_year_is_structured_only_when_calculated( assert response.json["status"] == "error" assert response.json["result"] is None assert response.json["errors"][0]["code"] == "SPM_YEAR_UNAVAILABLE" - assert "2036" in response.json["errors"][0]["message"] + assert "2037" in response.json["errors"][0]["message"] def test_uncertifiable_country_receipt_does_not_become_an_internal_failure(monkeypatch):