Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/us-2036-economy-year.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Offer 2036 as a US economy and household year, for the PolicyEngine bundle whose SPM forecast covers 2022–2036.
2 changes: 1 addition & 1 deletion docs/canonical-spm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions policyengine_api/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion policyengine_api/data/v2/catalog/extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/test_country_spm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down Expand Up @@ -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={
Expand All @@ -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):
Expand Down
Loading