Skip to content

Commit

Permalink
Merge pull request #772 from PolicyEngine/enhanced-cps
Browse files Browse the repository at this point in the history
Add support for enhanced CPS
  • Loading branch information
nikhilwoodruff authored Sep 22, 2023
2 parents 95b224a + 6d58a5d commit 00db175
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Support for the enhanced CPS in the US.
1 change: 1 addition & 0 deletions policyengine_api/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def build_microsimulation_options(self) -> dict:
elif self.country_id == "us":
region = [
dict(name="us", label="the US"),
dict(name="enhanced_us", label="the US (enhanced CPS)"),
dict(name="al", label="Alabama"),
dict(name="ak", label="Alaska"),
dict(name="az", label="Arizona"),
Expand Down
8 changes: 8 additions & 0 deletions policyengine_api/endpoints/economy/single_economy.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ def compute_economy(
time_period,
original_household_weight * in_nyc,
)
elif region == "enhanced_us":
simulation: Microsimulation = (
country.country_package.Microsimulation(
reform=reform,
dataset="enhanced_cps_2023",
)
)
simulation.default_calculation_period = time_period
else:
region_values = simulation.calculate("state_code_str").values
simulation.set_input(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"policyengine-ng==0.5.1",
"policyengine-il==0.1.0",
"policyengine_uk==0.55.2",
"policyengine_us==0.471.1",
"policyengine_us==0.472.0",
"pymysql",
"redis",
"rq",
Expand Down

0 comments on commit 00db175

Please sign in to comment.