File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed
policyengine_api/services Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 1+ - bump : minor
2+ changes :
3+ changed :
4+ - Set dataset to None for US state-level simulations in economy service
Original file line number Diff line number Diff line change @@ -484,11 +484,11 @@ def _setup_data(
484484 if dataset == "enhanced_cps" :
485485 return "gs://policyengine-us-data/enhanced_cps_2024.h5"
486486
487- # US state-level simulations must reference pooled CPS dataset
488- if country_id == "us" and region != "us " :
487+ # NYC simulations must reference pooled CPS dataset
488+ if region == "nyc " :
489489 return "gs://policyengine-us-data/pooled_3_year_cps_2023.h5"
490490
491- # All others receive no sim API 'data' arg
491+ # All others (including US state-level simulations) receive no sim API 'data' arg
492492 return None
493493
494494 # Note: The following methods that interface with the ReformImpactsService
Original file line number Diff line number Diff line change @@ -595,10 +595,7 @@ def test__given_us_state__returns_correct_sim_options(self):
595595 )
596596 assert sim_options ["time_period" ] == time_period
597597 assert sim_options ["region" ] == "state/ca"
598- assert (
599- sim_options ["data" ]
600- == "gs://policyengine-us-data/pooled_3_year_cps_2023.h5"
601- )
598+ assert sim_options ["data" ] is None
602599
603600 def test__given_enhanced_cps_state__returns_correct_sim_options (self ):
604601 # Test with enhanced_cps dataset
@@ -720,12 +717,25 @@ def test__given_enhanced_cps_dataset__returns_correct_gcp_path(self):
720717 # Assert the expected value
721718 assert result == "gs://policyengine-us-data/enhanced_cps_2024.h5"
722719
723- def test__given_us_state_dataset__returns_correct_gcp_path (self ):
724- # Test with US state dataset
720+ def test__given_us_state_dataset__returns_none (self ):
721+ # Test with US state dataset - should return None
725722 dataset = "us_state"
726723 country_id = "us"
727724 region = "ca"
728725
726+ # Create an instance of the class
727+ service = EconomyService ()
728+ # Call the method
729+ result = service ._setup_data (dataset , country_id , region )
730+ # Assert the expected value
731+ assert result is None
732+
733+ def test__given_nyc_region__returns_pooled_cps (self ):
734+ # Test with NYC region - should return pooled CPS dataset
735+ dataset = None
736+ country_id = "us"
737+ region = "nyc"
738+
729739 # Create an instance of the class
730740 service = EconomyService ()
731741 # Call the method
You can’t perform that action at this time.
0 commit comments