Skip to content

Commit 07582e2

Browse files
committed
fix: Ensure that NYC still uses Pooled 3-Year CPS
1 parent 5efdbef commit 07582e2

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

policyengine_api/services/economy_service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,10 @@ def _setup_data(
484484
if dataset == "enhanced_cps":
485485
return "gs://policyengine-us-data/enhanced_cps_2024.h5"
486486

487+
# NYC simulations must reference pooled CPS dataset
488+
if region == "nyc":
489+
return "gs://policyengine-us-data/pooled_3_year_cps_2023.h5"
490+
487491
# All others (including US state-level simulations) receive no sim API 'data' arg
488492
return None
489493

tests/unit/services/test_economy_service.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,21 @@ def test__given_us_state_dataset__returns_none(self):
733733
# Assert the expected value
734734
assert result is None
735735

736+
def test__given_nyc_region__returns_pooled_cps(self):
737+
# Test with NYC region - should return pooled CPS dataset
738+
dataset = None
739+
country_id = "us"
740+
region = "nyc"
741+
742+
# Create an instance of the class
743+
service = EconomyService()
744+
# Call the method
745+
result = service._setup_data(dataset, country_id, region)
746+
# Assert the expected value
747+
assert (
748+
result == "gs://policyengine-us-data/pooled_3_year_cps_2023.h5"
749+
)
750+
736751
def test__given_us_nationwide_dataset__returns_none(self):
737752
# Test with US nationwide dataset
738753
dataset = "us_nationwide"

0 commit comments

Comments
 (0)