summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
authorMichael <michael.siebert2k@gmail.com>2023-01-13 21:24:35 +0100
committerGitHub <noreply@github.com>2023-01-13 21:24:35 +0100
commit2303556949b96c4220ed86fa4554f6a87dec3842 (patch)
treed88bc32af66dbfe442074007e51f0d3ad9a719eb /numpy/lib/tests
parent87ba79b05e5eab101b03e1cc76656287d5d0aed5 (diff)
downloadnumpy-2303556949b96c4220ed86fa4554f6a87dec3842.tar.gz
ENH: Faster numpy.load (try/except _filter_header) (#22916)
This pull requests speeds up numpy.load. Since _filter_header is quite a bottleneck, we only run it if we must. Users will get a warning if they have a legacy Numpy file so that they can save it again for faster loading. Main discussion and benchmarks see #22898 Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test_format.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
index 6f6406cf8..58d08f1e5 100644
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -531,7 +531,8 @@ def test_load_padded_dtype(tmpdir, dt):
def test_python2_python3_interoperability():
fname = 'win64python2.npy'
path = os.path.join(os.path.dirname(__file__), 'data', fname)
- data = np.load(path)
+ with pytest.warns(UserWarning, match="Reading.*this warning\\."):
+ data = np.load(path)
assert_array_equal(data, np.ones(2))
def test_pickle_python2_python3():