Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: patch
changes:
fixed:
- Bug with the 2023 CPS.
4 changes: 4 additions & 0 deletions policyengine_api/jobs/calculate_economy_simulation_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@
region_sim = Microsimulation(
dataset=filter_dataset,
reform=reform,
default_input_period=(
2023 if "2023" in filter_dataset else None
),
)
df = region_sim.to_input_dataframe()
state_code = region_sim.calculate(
Expand All @@ -653,6 +656,7 @@

if dataset == "default" and region == "us":
sim_options["dataset"] = datasets["us"]["cps"]
sim_options["default_input_period"] = 2023

Check warning on line 659 in policyengine_api/jobs/calculate_economy_simulation_job.py

View check run for this annotation

Codecov / codecov/patch

policyengine_api/jobs/calculate_economy_simulation_job.py#L659

Added line #L659 was not covered by tests

# Return completed simulation
return Microsimulation(**sim_options)
Expand Down
4 changes: 2 additions & 2 deletions tests/to_refactor/python/test_us_policy_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def utah_reform_runner(rest_client, region: str = "us"):
)

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

Expand Down
Loading