Skip to content

Commit

Permalink
filter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdillon committed Oct 16, 2024
1 parent 86e633c commit 9852412
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 4 additions & 2 deletions hera_cal/tests/test_abscal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,8 +1790,10 @@ def test_post_redcal_abscal_run_units_warning(self, tmpdir):
hcr.gain_scale = 'k str'
hcr.write_calfits(calfile_units)
with pytest.warns(RuntimeWarning, match='Overwriting redcal gain_scale of k str with model gain_scale of Jy'):
hca = abscal.post_redcal_abscal_run(self.data_file, calfile_units, [model_units], phs_conv_crit=1e-4,
nInt_to_load=30, verbose=False, add_to_history='testing')
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="All-NaN slice encountered")
hca = abscal.post_redcal_abscal_run(self.data_file, calfile_units, [model_units], phs_conv_crit=1e-4,
nInt_to_load=30, verbose=False, add_to_history='testing')
assert hca.gain_scale == 'Jy'

def test_post_redcal_abscal_run(self, tmpdir):
Expand Down
8 changes: 6 additions & 2 deletions hera_cal/tests/test_frf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,9 @@ def test_get_frop_for_noise():
def test_prep_var_for_frop():
uvh5 = os.path.join(DATA_PATH, "test_input/zen.2458101.46106.xx.HH.OCR_53x_54x_only.uvh5")
hd = io.HERAData([uvh5])
data, flags, nsamples = hd.read(fix_autos=True)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="Fixing auto-correlations")
data, flags, nsamples = hd.read()
# The first 37 freqs give 0 variance so just exclude them to make the rest
# of the test more transparent
freq_slice = slice(37, 1024)
Expand Down Expand Up @@ -1213,7 +1215,9 @@ def test_prep_var_for_frop():
def test_get_FRF_cov():
uvh5 = os.path.join(DATA_PATH, "test_input/zen.2458101.46106.xx.HH.OCR_53x_54x_only.uvh5")
hd = io.HERAData([uvh5])
data, flags, nsamples = hd.read(fix_autos=True)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="Fixing auto-correlations")
data, flags, nsamples = hd.read()
# The first 37 freqs give 0 variance so just exclude them to make the rest
# of the test more transparent
freq_slice = slice(37, 1024)
Expand Down

0 comments on commit 9852412

Please sign in to comment.