Skip to content

Commit

Permalink
Merge pull request #2811 from martinholmer/fix-cli
Browse files Browse the repository at this point in the history
Fix CLI tool weights file handling
  • Loading branch information
martinholmer authored Sep 26, 2024
2 parents 56dba1b + 86b8b74 commit 4471479
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions taxcalc/taxcalcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,24 +347,25 @@ def init(self, input_data, tax_year, baseline, reform, assump,
gfactors=gfactors_base,
exact_calculations=exact_calculations
)
elif self.tmd_input_data:
elif self.tmd_input_data: # pragma: no cover
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
) # pragma: no cover
)
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,
Expand Down

0 comments on commit 4471479

Please sign in to comment.