Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Mar 27, 2024
1 parent 942637d commit 8e9db3c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tests/test_basic_flat_file.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
def test_flat_file_runs():
import taxcalc as tc
from tax_microdata_benchmarking.create_flat_file import create_flat_file
import pandas as pd

create_flat_file()
cps_based_flat_file = create_flat_file(source_dataset="enhanced_cps_2022")

try:
puf_based_flat_file = create_flat_file(source_dataset="puf_2022")
nonfilers_file = cps_based_flat_file[
cps_based_flat_file.is_tax_filer == 0
]
stacked_file = pd.concat([puf_based_flat_file, nonfilers_file])
cps_based_flat_file.to_csv(
"tax_microdata_cps_based.csv.gz", index=False
)
puf_based_flat_file.to_csv(
"tax_microdata_puf_based.csv.gz", index=False
)
nonfilers_file.to_csv("tax_microdata_nonfilers.csv.gz", index=False)
stacked_file.to_csv("tax_microdata.csv.gz", index=False)
except:
print("PUF-based data not available.")
cps_based_flat_file.to_csv("tax_microdata.csv.gz", index=False)

input_data = tc.Records("tax_microdata.csv.gz")
policy = tc.Policy()
Expand Down

0 comments on commit 8e9db3c

Please sign in to comment.