Skip to content

Commit

Permalink
Fix pylint C1802 and C2801 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Jan 5, 2025
1 parent 3b60df7 commit 9e2d3b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion taxcalc/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def adjust_with_indexing(self, params_or_path, **kwargs):
min_index_change_year, strict=False
)

if len(list(vos)):
if list(vos):
min_adj_year = min(vos, key=lambda vo: vo["year"])[
"year"
]
Expand Down
10 changes: 5 additions & 5 deletions taxcalc/taxcalcio.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ def init(self, input_data, tax_year, baseline, reform, assump,
try:
gdiff_baseline.update_growdiff(paramdict['growdiff_baseline'])
except paramtools.ValidationError as valerr_msg:
self.errmsg += valerr_msg.__str__()
self.errmsg += str(valerr_msg)
# apply gdiff_baseline to gfactor_base
gdiff_baseline.apply_to(gfactors_base)
# specify gdiff_response object
gdiff_response = GrowDiff(last_budget_year=last_b_year)
try:
gdiff_response.update_growdiff(paramdict['growdiff_response'])
except paramtools.ValidationError as valerr_msg:
self.errmsg += valerr_msg.__str__()
self.errmsg += str(valerr_msg)
# apply gdiff_baseline and gdiff_response to gfactor_ref
gdiff_baseline.apply_to(gfactors_ref)
gdiff_response.apply_to(gfactors_ref)
Expand All @@ -323,7 +323,7 @@ def init(self, input_data, tax_year, baseline, reform, assump,
for _, errors in base.parameter_errors.items():
self.errmsg += "\n".join(errors)
except paramtools.ValidationError as valerr_msg:
self.errmsg += valerr_msg.__str__()
self.errmsg += str(valerr_msg)
# ... the reform Policy object
if self.specified_reform:
pol = Policy(gfactors=gfactors_ref, last_budget_year=last_b_year)
Expand All @@ -337,15 +337,15 @@ def init(self, input_data, tax_year, baseline, reform, assump,
for _, errors in pol.parameter_errors.items():
self.errmsg += "\n".join(errors)
except paramtools.ValidationError as valerr_msg:
self.errmsg += valerr_msg.__str__()
self.errmsg += str(valerr_msg)
else:
pol = Policy(gfactors=gfactors_base, last_budget_year=last_b_year)
# create Consumption object
con = Consumption(last_budget_year=last_b_year)
try:
con.update_consumption(paramdict['consumption'])
except paramtools.ValidationError as valerr_msg:
self.errmsg += valerr_msg.__str__()
self.errmsg += str(valerr_msg)
# any errors imply cannot proceed with calculations
if self.errmsg:
return
Expand Down

0 comments on commit 9e2d3b9

Please sign in to comment.