diff --git a/src/gollum/precomputed_spectrum.py b/src/gollum/precomputed_spectrum.py index 3124f0f..369efd1 100644 --- a/src/gollum/precomputed_spectrum.py +++ b/src/gollum/precomputed_spectrum.py @@ -115,7 +115,8 @@ def rotationally_broaden(self, vsini, u1=0.0, u2=0.0): """ lam0 = np.median(self.wavelength.value) x2 = (299792.458 * (self.wavelength.value - lam0) / (lam0 * vsini)) ** 2 - with catch_warnings(action="ignore", category=RuntimeWarning): + with catch_warnings(): + filterwarnings("ignore", category=RuntimeWarning) kernel = np.where( x2 < 1, np.pi / 2 * u1 * (1 - x2) diff --git a/tests/test_phoenix.py b/tests/test_phoenix.py index 6a12849..2b498ef 100644 --- a/tests/test_phoenix.py +++ b/tests/test_phoenix.py @@ -68,7 +68,8 @@ def test_resample(): def test_grid(): """Testing the PHOENIXGrid methods""" - with catch_warnings(action='ignore', category=DeprecationWarning): + with catch_warnings(): + filterwarnings("ignore", category=DeprecationWarning) grid = PHOENIXGrid( teff_range=(5000, 5100), logg_range=(2, 2.5), Z_range=(0, 0.5), experimental=True, download=True )