From 52460b360d1e63d34d7764a73ec4bff94c17b104 Mon Sep 17 00:00:00 2001 From: "martin.holmer@gmail.com" Date: Thu, 7 Nov 2024 15:39:42 -0500 Subject: [PATCH] Consolidate logical statements --- taxcalc/calculator.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/taxcalc/calculator.py b/taxcalc/calculator.py index 014ae2369..fe5e9a21c 100644 --- a/taxcalc/calculator.py +++ b/taxcalc/calculator.py @@ -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)