Skip to content

Commit

Permalink
Merge pull request #35 from martinholmer/update-runs-script
Browse files Browse the repository at this point in the history
Update examination/taxcalculator/runs.sh script to handle Phase 2 and 3 datasets
  • Loading branch information
martinholmer authored Apr 10, 2024
2 parents 23f9dda + e158dd4 commit 9af81af
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion tax_microdata_benchmarking/examination/taxcalculator/runs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
# Execute several Tax-Calculator runs using the execute.sh script.
# USAGE:
# ./runs.sh DATAFILE(without_trailing_.csv) YEAR(tailing_two_digits)
# DATAFILES: puf|pe23 (where puf is from the taxdata repository)
# DATAFILES: puf|pe23|xb23|xb26|xc23|xc26
# (where puf is from the taxdata repository)
# (where pe23 is the Phase 1 work product)
# (where xb23 and xb26 are Phase 2 work products)
# (where xc23 and xc26 are Phase 3 work products)

D="DATAFILE(without_trailing_.csv)"
Y="YEAR(tailing_two_digits)"
Expand All @@ -24,6 +28,42 @@ if [[ "$1" == "pe23" ]]; then
fi
OK=1
fi
if [[ "$1" == "xb23" ]]; then
unzip -oq xb23.csv.zip
if [[ "$2" != "23" ]]; then
echo "ERROR: YEAR not equal to 23" >&2
echo "USAGE: ./runs.sh xb23 23" >&2
exit 1
fi
OK=1
fi
if [[ "$1" == "xb26" ]]; then
unzip -oq xb26.csv.zip
if [[ "$2" != "26" ]]; then
echo "ERROR: YEAR not equal to 26" >&2
echo "USAGE: ./runs.sh xb26 26" >&2
exit 1
fi
OK=1
fi
if [[ "$1" == "xc23" ]]; then
unzip -oq xc23.csv.zip
if [[ "$2" != "23" ]]; then
echo "ERROR: YEAR not equal to 23" >&2
echo "USAGE: ./runs.sh xc23 23" >&2
exit 1
fi
OK=1
fi
if [[ "$1" == "xc26" ]]; then
unzip -oq xc26.csv.zip
if [[ "$2" != "26" ]]; then
echo "ERROR: YEAR not equal to 26" >&2
echo "USAGE: ./runs.sh xc26 26" >&2
exit 1
fi
OK=1
fi
if [[ "$OK" -ne 1 ]]; then
echo "ERROR: DATAFILE is neither 'puf' nor 'pe23'" >&2
echo "USAGE: ./runs.sh $D $Y" >&2
Expand Down

0 comments on commit 9af81af

Please sign in to comment.