Skip to content

Commit 922df6d

Browse files
authored
Merge pull request #2545 from PolicyEngine/nikhilwoodruff/issue2544
2023 CPS is uprated one year too few
2 parents eeb5a81 + e685c16 commit 922df6d

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
fixed:
4+
- Bug with the 2023 CPS.

policyengine_api/jobs/calculate_economy_simulation_job.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,9 @@ def _create_simulation_us(
637637
region_sim = Microsimulation(
638638
dataset=filter_dataset,
639639
reform=reform,
640+
default_input_period=(
641+
2023 if "2023" in filter_dataset else None
642+
),
640643
)
641644
df = region_sim.to_input_dataframe()
642645
state_code = region_sim.calculate(
@@ -653,6 +656,7 @@ def _create_simulation_us(
653656

654657
if dataset == "default" and region == "us":
655658
sim_options["dataset"] = datasets["us"]["cps"]
659+
sim_options["default_input_period"] = 2023
656660

657661
# Return completed simulation
658662
return Microsimulation(**sim_options)

tests/to_refactor/python/test_us_policy_macro.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ def utah_reform_runner(rest_client, region: str = "us"):
7777
)
7878

7979
assert (
80-
result["intra_decile"]["all"]["Lose less than 5%"] / 0.622 - 1
80+
result["intra_decile"]["all"]["Lose less than 5%"] / 0.637 - 1
8181
) < 0.01, (
82-
f"Expected 62.2% of people to lose less than 5%, got "
82+
f"Expected 63.7% of people to lose less than 5%, got "
8383
f"{result['intra_decile']['all']['Lose less than 5%']}"
8484
)
8585

0 commit comments

Comments
 (0)