From 1d1b6e2cf03fab17919234544b663b4d18978a22 Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Thu, 26 Sep 2024 12:51:45 -0400 Subject: [PATCH] Fix CLI tool weights file handling --- taxcalc/taxcalcio.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/taxcalc/taxcalcio.py b/taxcalc/taxcalcio.py index 9bd7f7d51..44dc44388 100644 --- a/taxcalc/taxcalcio.py +++ b/taxcalc/taxcalcio.py @@ -348,10 +348,11 @@ def init(self, input_data, tax_year, baseline, reform, assump, exact_calculations=exact_calculations ) elif self.tmd_input_data: + wghts = pd.read_csv(self.tmd_weights) recs = Records( data=pd.read_csv(input_data), start_year=Records.TMDCSV_YEAR, - weights=self.tmd_weights, + weights=wghts, gfactors=gfactors_ref, adjust_ratios=None, exact_calculations=exact_calculations @@ -359,12 +360,12 @@ def init(self, input_data, tax_year, baseline, reform, assump, recs_base = Records( data=pd.read_csv(input_data), start_year=Records.TMDCSV_YEAR, - weights=self.tmd_weights, + weights=wghts, gfactors=gfactors_base, adjust_ratios=None, exact_calculations=exact_calculations ) # pragma: no cover - else: # if not {cps|tmd}_input_data but aging_input_data + else: # if not {cps|tmd}_input_data but aging_input_data: puf recs = Records( data=input_data, gfactors=gfactors_ref,