From 0f5c6633140fc1fac0d6b4fcadd6b93ba70851e8 Mon Sep 17 00:00:00 2001 From: trichter Date: Mon, 27 Feb 2023 17:03:30 +0100 Subject: [PATCH] fix np.warnings missing for np>=1.24 --- yam/tests/test_correlate.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yam/tests/test_correlate.py b/yam/tests/test_correlate.py index a3f049b..7df91e8 100644 --- a/yam/tests/test_correlate.py +++ b/yam/tests/test_correlate.py @@ -1,6 +1,7 @@ # Copyright 2017-2019 Tom Eulenfeld, MIT license import unittest import sys +import warnings import numpy as np from obspy import read, read_inventory, UTCDateTime as UTC @@ -282,8 +283,8 @@ def test_preprocess(self): # see https://docs.scipy.org/doc/numpy-1.13.0/release.html# # assigning-to-slices-views-of-maskedarray ignore_msg = r'setting an item on a masked array which has a shared' - with np.warnings.catch_warnings(): - np.warnings.filterwarnings('ignore', ignore_msg) + with warnings.catch_warnings(): + warnings.filterwarnings('ignore', ignore_msg) preprocess(stream, day=day, inventory=read_inventory(), remove_response=True, filter=None,