diff --git a/tests/uvbeam/test_uvbeam.py b/tests/uvbeam/test_uvbeam.py index e9a16b410..f00b31ba5 100644 --- a/tests/uvbeam/test_uvbeam.py +++ b/tests/uvbeam/test_uvbeam.py @@ -842,7 +842,7 @@ def test_freq_interp_real_and_complex(cst_power_2freq): # interpolate cubic on complex data and compare to ensure they are the same pbeam.data_array = pbeam.data_array.astype(np.complex128) pb_int2 = pbeam.interp(freq_array=freqs)[0] - assert np.all(np.isclose(np.abs(pb_int - pb_int2), 0)) + np.testing.assert_allclose(np.abs(pb_int - pb_int2), 0) @pytest.mark.parametrize("beam_type", ["efield", "power", "phased_array"]) diff --git a/tests/uvcal/test_uvcal.py b/tests/uvcal/test_uvcal.py index b70ea4cb6..196bc48b4 100644 --- a/tests/uvcal/test_uvcal.py +++ b/tests/uvcal/test_uvcal.py @@ -3145,7 +3145,7 @@ def test_uvcal_get_methods(gain_data): quality_arr = uvc.get_quality(key) # test shapes - assert np.all(np.isclose(gain_arr, 0.0)) + np.testing.assert_allclose(gain_arr, 0.0) assert gain_arr.shape == (uvc.Nfreqs, uvc.Ntimes) assert flag_arr.shape == (uvc.Nfreqs, uvc.Ntimes) assert quality_arr.shape == (uvc.Nfreqs, uvc.Ntimes) diff --git a/tests/uvdata/test_mwa_corr_fits.py b/tests/uvdata/test_mwa_corr_fits.py index 2bfd5d2a2..2ebb63e99 100644 --- a/tests/uvdata/test_mwa_corr_fits.py +++ b/tests/uvdata/test_mwa_corr_fits.py @@ -1081,7 +1081,12 @@ def test_van_vleck_cheby(): good_ants = np.delete(np.unique(uv2.ant_1_array), 76) uv2.select(antenna_nums=good_ants) - assert uv1._data_array == uv2._data_array + np.testing.assert_allclose( + uv1.data_array, + uv2.data_array, + rtol=uv1._data_array.tols[0], + atol=uv1._data_array.tols[1], + ) def test_van_vleck_interp(tmp_path): @@ -1344,4 +1349,9 @@ def test_van_vleck(benchmark, cheby): good_ants = np.delete(np.unique(uv2.ant_1_array), 76) uv2.select(antenna_nums=good_ants) - assert uv1._data_array == uv2._data_array + np.testing.assert_allclose( + uv1.data_array, + uv2.data_array, + rtol=uv1._data_array.tols[0], + atol=uv1._data_array.tols[1], + ) diff --git a/tests/uvdata/test_uvdata.py b/tests/uvdata/test_uvdata.py index 151b8d299..d32e77846 100644 --- a/tests/uvdata/test_uvdata.py +++ b/tests/uvdata/test_uvdata.py @@ -8684,7 +8684,7 @@ def test_resample_in_time(bda_test_file, driftscan, partial_phase): uv_object.resample_in_time(8, allow_drift=True) # Should have all the target integration time - assert np.all(np.isclose(uv_object.integration_time, 8)) + np.testing.assert_allclose(uv_object.integration_time, 8) # 2s integration time out_data_1_136 = uv_object.get_data((1, 136))