Skip to content

Commit

Permalink
stop rerun of test if TAXSIM32 files exist
Browse files Browse the repository at this point in the history
  • Loading branch information
chusloj committed Feb 26, 2021
1 parent a23d8d9 commit fd038bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions taxcalc/validation/taxsim32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ the document that generates data for input into TAXSIM-32, see the TAXSIM-32 web
Instructions
------------------
1. Navigate to `taxcalc/validation/taxsim32` and run the Python script `tests_32.py`.
2. If you would like to generate new input files and and get new files from TAXSIM-32,
just delete all of the `.in.out-taxsim` files. On Mac/Linux, this can be done with
`rm -f *.in.out-taxsim`.


Troubleshooting
Expand Down
13 changes: 10 additions & 3 deletions taxcalc/validation/taxsim32/tests_32.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import os
import glob
import input_setup
import main_comparison

CUR_PATH = os.path.abspath(os.path.dirname(__file__))

# setup input files
input_setup.main()
if not glob.glob(os.path.join(CUR_PATH, '*in.out-taxsim')):
input_setup.main()

# run taxcalc/taxsim comparison
for assump_set in ('a', 'b', 'c'):
for year in (18, 19):
main_comparison.main(assump_set, year)

# clean up auxillary files
os.system('rm -f *.in* *.out*')
# clean up all files except those retrieved from TAXSIM32
for file in CUR_PATH:
for file in glob.glob('*.out*') and glob.glob('*.in*'):
if not file.endswith('taxsim'):
os.remove(file)

0 comments on commit fd038bd

Please sign in to comment.