From dd435bfd5f3a5fbd063058483c42ea11ec151eca Mon Sep 17 00:00:00 2001 From: Matthew Kolopanis Date: Mon, 6 Nov 2023 11:09:11 -0700 Subject: [PATCH] use diff and comparison with rectangularity calc --- pyuvdata/utils.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/pyuvdata/utils.py b/pyuvdata/utils.py index c2038b03fc..7993611f59 100644 --- a/pyuvdata/utils.py +++ b/pyuvdata/utils.py @@ -6137,11 +6137,7 @@ def determine_rectangularity( baseline_array = baseline_array.reshape((nbls, ntimes)) if np.sum(np.abs(np.diff(time_array, axis=0))) != 0: return False, False - if np.any( - np.logical_not( - np.apply_along_axis(lambda x: np.allclose(x, x[0]), 1, baseline_array) - ) - ): + if (np.diff(baseline_array, axis=1) != 0).any(): return False, False return True, True elif bl_first: @@ -6149,10 +6145,6 @@ def determine_rectangularity( baseline_array = baseline_array.reshape((ntimes, nbls)) if np.sum(np.abs(np.diff(time_array, axis=1))) != 0: return False, False - if np.any( - np.logical_not( - np.apply_along_axis(lambda x: np.allclose(x, x[0]), 0, baseline_array) - ) - ): + if (np.diff(baseline_array, axis=0) != 0).any(): return False, False return True, False