Skip to content

Commit dca1c0a

Browse files
bhazeltonmkolopanis
authored andcommitted
Fix a few more places per review comments
1 parent ce35398 commit dca1c0a

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

tests/uvbeam/test_uvbeam.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def test_freq_interp_real_and_complex(cst_power_2freq):
842842
# interpolate cubic on complex data and compare to ensure they are the same
843843
pbeam.data_array = pbeam.data_array.astype(np.complex128)
844844
pb_int2 = pbeam.interp(freq_array=freqs)[0]
845-
assert np.all(np.isclose(np.abs(pb_int - pb_int2), 0))
845+
np.testing.assert_allclose(np.abs(pb_int - pb_int2), 0)
846846

847847

848848
@pytest.mark.parametrize("beam_type", ["efield", "power", "phased_array"])

tests/uvcal/test_uvcal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,7 @@ def test_uvcal_get_methods(gain_data):
31453145
quality_arr = uvc.get_quality(key)
31463146

31473147
# test shapes
3148-
assert np.all(np.isclose(gain_arr, 0.0))
3148+
np.testing.assert_allclose(gain_arr, 0.0)
31493149
assert gain_arr.shape == (uvc.Nfreqs, uvc.Ntimes)
31503150
assert flag_arr.shape == (uvc.Nfreqs, uvc.Ntimes)
31513151
assert quality_arr.shape == (uvc.Nfreqs, uvc.Ntimes)

tests/uvdata/test_mwa_corr_fits.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,12 @@ def test_van_vleck_cheby():
10811081
good_ants = np.delete(np.unique(uv2.ant_1_array), 76)
10821082
uv2.select(antenna_nums=good_ants)
10831083

1084-
assert uv1._data_array == uv2._data_array
1084+
np.testing.assert_allclose(
1085+
uv1.data_array,
1086+
uv2.data_array,
1087+
rtol=uv1._data_array.tols[0],
1088+
atol=uv1._data_array.tols[1],
1089+
)
10851090

10861091

10871092
def test_van_vleck_interp(tmp_path):
@@ -1344,4 +1349,9 @@ def test_van_vleck(benchmark, cheby):
13441349
good_ants = np.delete(np.unique(uv2.ant_1_array), 76)
13451350
uv2.select(antenna_nums=good_ants)
13461351

1347-
assert uv1._data_array == uv2._data_array
1352+
np.testing.assert_allclose(
1353+
uv1.data_array,
1354+
uv2.data_array,
1355+
rtol=uv1._data_array.tols[0],
1356+
atol=uv1._data_array.tols[1],
1357+
)

tests/uvdata/test_uvdata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8684,7 +8684,7 @@ def test_resample_in_time(bda_test_file, driftscan, partial_phase):
86848684

86858685
uv_object.resample_in_time(8, allow_drift=True)
86868686
# Should have all the target integration time
8687-
assert np.all(np.isclose(uv_object.integration_time, 8))
8687+
np.testing.assert_allclose(uv_object.integration_time, 8)
86888688

86898689
# 2s integration time
86908690
out_data_1_136 = uv_object.get_data((1, 136))

0 commit comments

Comments
 (0)