Skip to content

Commit ce35398

Browse files
bhazeltonmkolopanis
authored andcommitted
Address review comments
also fix a couple more places I missed before.
1 parent a94be83 commit ce35398

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

tests/uvcal/test_fhd_cal.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,12 @@ def test_read_fhdcal_metadata(raw, fhd_cal_raw, fhd_cal_fit):
9898
# there is a loss in precision for float auto scale values in the
9999
# settings file vs the cal file
100100
# first check that they are similar (extract from the string they are packed in)
101-
assert np.allclose(
101+
# only test to single precision because that's how it's stored.
102+
np.testing.assert_allclose(
102103
np.asarray(fhd_cal.extra_keywords["AUTOSCAL"][1:-1].split(", "), dtype=float),
103104
np.asarray(fhd_cal2.extra_keywords["AUTOSCAL"][1:-1].split(", "), dtype=float),
105+
atol=0,
106+
rtol=2e-6,
104107
)
105108
# replace the strings to prevent errors
106109
fhd_cal.extra_keywords["autoscal".upper()] = fhd_cal2.extra_keywords[

tests/uvcal/test_initializers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,18 @@ def test_new_uvcal_jones_array(uvc_simplest):
213213

214214
circ = new_uvcal(jones_array="circular", **uvc)
215215
assert circ.Njones == 4
216-
assert np.allclose(circ.jones_array, np.array([-1, -2, -3, -4]))
216+
np.testing.assert_allclose(circ.jones_array, np.array([-1, -2, -3, -4]))
217217

218218
custom = new_uvcal(jones_array=np.array([-1, -3]), **uvc)
219219
assert custom.Njones == 2
220220

221221
linear_alt = new_uvcal(jones_array=["xx", "yy"], **uvc)
222222
assert linear_alt.Njones == 2
223-
assert np.allclose(linear_alt.jones_array, np.array([-5, -6]))
223+
np.testing.assert_allclose(linear_alt.jones_array, np.array([-5, -6]))
224224

225225
linear_physical = new_uvcal(jones_array=["nn", "ee", "ne", "en"], **uvc)
226226
assert linear_physical.Njones == 4
227-
assert np.allclose(linear_physical.jones_array, np.array([-5, -6, -7, -8]))
227+
np.testing.assert_allclose(linear_physical.jones_array, np.array([-5, -6, -7, -8]))
228228

229229

230230
def test_new_uvcal_set_sky(uvc_simplest):

tests/uvdata/test_mwa_corr_fits.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,12 @@ def test_van_vleck_int():
10521052
# read in file corrected using integrate.quad with 1e-10 precision
10531053
uv2 = UVData()
10541054
uv2.read(filelist[10])
1055-
assert uv1._data_array == uv2._data_array
1055+
np.testing.assert_allclose(
1056+
uv1.data_array,
1057+
uv2.data_array,
1058+
rtol=uv1._data_array.tols[0],
1059+
atol=uv1._data_array.tols[1],
1060+
)
10561061

10571062

10581063
@pytest.mark.filterwarnings("ignore:some coarse channel files were not submitted")

0 commit comments

Comments
 (0)