From 90007c1d0382a93411585d517f57691207984c7f 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 89058042c5..944af495a2 100644 --- a/pyuvdata/utils.py +++ b/pyuvdata/utils.py @@ -6044,11 +6044,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: @@ -6056,10 +6052,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