Skip to content

Commit

Permalink
Fix a few more places per review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bhazelton authored and mkolopanis committed Oct 30, 2024
1 parent ce35398 commit dca1c0a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/uvbeam/test_uvbeam.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
2 changes: 1 addition & 1 deletion tests/uvcal/test_uvcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 12 additions & 2 deletions tests/uvdata/test_mwa_corr_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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],
)
2 changes: 1 addition & 1 deletion tests/uvdata/test_uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit dca1c0a

Please sign in to comment.