Skip to content

Commit

Permalink
Consolidate logical statements
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholmer committed Nov 7, 2024
1 parent 73b0aee commit 52460b3
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions taxcalc/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,14 +1189,9 @@ def lines(text, num_indent_spaces, max_line_length=77):
for pname in baseline.keys():
upda_value = getattr(updated, pname)
base_value = getattr(baseline, pname)
is_diff = False
if isinstance(upda_value, np.ndarray):
if not np.allclose(upda_value, base_value):
is_diff = True
else:
if upda_value != base_value:
is_diff = True
if is_diff:
isarray = isinstance(upda_value, np.ndarray)
if ((isarray and not np.allclose(upda_value, base_value))
or (not is_array and upda_value != base_value)):
params_with_diff.append(pname)
if params_with_diff:
mdata_base = baseline.specification(meta_data=True)
Expand Down

0 comments on commit 52460b3

Please sign in to comment.