From 9d2e498b208102caca40c10978c1124fb03d016a Mon Sep 17 00:00:00 2001 From: David Trimmer Date: Wed, 14 Oct 2026 13:48:55 -0400 Subject: [PATCH 1/2] Offer 2036 as a US year in economy options and the v2 catalog Add 2036 to the US time_period options and to the v2 catalog's METADATA_TIME_PERIODS, and update the canonical SPM contract doc's horizon. This must ship with the PolicyEngine bundle whose SPM forecast covers 2036; until then a 2036 request fails with SPM_YEAR_UNAVAILABLE. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LqCGPgxDukji8Bhs57c5rH --- changelog.d/us-2036-economy-year.added.md | 1 + docs/canonical-spm.md | 2 +- policyengine_api/country.py | 1 + policyengine_api/data/v2/catalog/extraction.py | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelog.d/us-2036-economy-year.added.md 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 0f4c5c958..3409f4180 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 1c090ceda..af34c290a 100644 --- a/policyengine_api/country.py +++ b/policyengine_api/country.py @@ -296,6 +296,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 9aa18b61c..f9938fdb6 100644 --- a/policyengine_api/data/v2/catalog/extraction.py +++ b/policyengine_api/data/v2/catalog/extraction.py @@ -66,7 +66,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)), } PLACEHOLDER_VERSIONS = frozenset({"", "0", "0.0", "0.0.0", "unknown"}) From b1d0f784ff1287a2ac76d37257fc4456908b34df Mon Sep 17 00:00:00 2001 From: David Trimmer Date: Mon, 26 Oct 2026 15:14:33 -0400 Subject: [PATCH 2/2] Use 2037 as the year after the SPM forecast in the certified-bundle test The year-after-forecast missing-input case runs against the certified bundle's installed forecast. Once the bundle carries spm-calculator 1.1.0, 2036 is inside the forecast, so the case moves to 2037, which is outside both the current and the 2036 forecast. Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/unit/test_country_spm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_country_spm.py b/tests/unit/test_country_spm.py index ebe9bde0a..1fa4ee49d 100644 --- a/tests/unit/test_country_spm.py +++ b/tests/unit/test_country_spm.py @@ -490,9 +490,9 @@ def household(self, *, axes=False): ), "year-after-forecast": MissingInputCase( "SPM_YEAR_UNAVAILABLE", - "Forecast has no entry for 2036", + "Forecast has no entry for 2037", geography_kind="national", - year="2036", + year="2037", ), }