Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
also fix a couple more places I missed before.
  • Loading branch information
bhazelton committed Oct 29, 2024
1 parent 683a677 commit 982fb1c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 4 additions & 1 deletion tests/uvcal/test_fhd_cal.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,12 @@ def test_read_fhdcal_metadata(raw, fhd_cal_raw, fhd_cal_fit):
# there is a loss in precision for float auto scale values in the
# settings file vs the cal file
# first check that they are similar (extract from the string they are packed in)
assert np.allclose(
# only test to single precision because that's how it's stored.
np.testing.assert_allclose(
np.asarray(fhd_cal.extra_keywords["AUTOSCAL"][1:-1].split(", "), dtype=float),
np.asarray(fhd_cal2.extra_keywords["AUTOSCAL"][1:-1].split(", "), dtype=float),
atol=0,
rtol=2e-6,
)
# replace the strings to prevent errors
fhd_cal.extra_keywords["autoscal".upper()] = fhd_cal2.extra_keywords[
Expand Down
6 changes: 3 additions & 3 deletions tests/uvcal/test_initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,18 @@ def test_new_uvcal_jones_array(uvc_simplest):

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

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

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

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


def test_new_uvcal_set_sky(uvc_simplest):
Expand Down
7 changes: 6 additions & 1 deletion tests/uvdata/test_mwa_corr_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,12 @@ def test_van_vleck_int():
# read in file corrected using integrate.quad with 1e-10 precision
uv2 = UVData()
uv2.read(filelist[10])
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],
)


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

0 comments on commit 982fb1c

Please sign in to comment.