summaryrefslogtreecommitdiff
path: root/numpy/lib
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2018-12-01 10:29:03 -0800
committerGitHub <noreply@github.com>2018-12-01 10:29:03 -0800
commitb637e654706ae7efbf556091cb663197e2f28774 (patch)
tree5841e9994afaa0fcbdc5aea56e42433e89eab956 /numpy/lib
parente0122a4fc3bf9453220c2802a50c253a381b59c9 (diff)
parent845def00c85f9f40cfa64e6dabb4158bebd502f4 (diff)
downloadnumpy-b637e654706ae7efbf556091cb663197e2f28774.tar.gz
Merge pull request #12447 from ahaldane/unrevert_multifield_view
ENH: add back the multifield copy->view change
Diffstat (limited to 'numpy/lib')
-rw-r--r--numpy/lib/tests/test_io.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index b746937b9..f2d5d4ab5 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -355,6 +355,16 @@ class TestSaveTxt(object):
c.seek(0)
assert_equal(c.readlines(), [b'1 2\n', b'3 4\n'])
+ @pytest.mark.skipif(Path is None, reason="No pathlib.Path")
+ def test_multifield_view(self):
+ a = np.ones(1, dtype=[('x', 'i4'), ('y', 'i4'), ('z', 'f4')])
+ v = a[['x', 'z']]
+ with temppath(suffix='.npy') as path:
+ path = Path(path)
+ np.save(path, v)
+ data = np.load(path)
+ assert_array_equal(data, v)
+
def test_delimiter(self):
a = np.array([[1., 2.], [3., 4.]])
c = BytesIO()