[h5py] 23/26: Workaround for HDF5 slow-read bug

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:20:19 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 1.3.1
in repository h5py.

commit 28762c5d752feb66b13d86b6449ad3c35ad9a87c
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Sun Nov 28 23:09:07 2010 +0000

    Workaround for HDF5 slow-read bug
---
 h5py/highlevel.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index d103c47..97f5c60 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -1216,8 +1216,15 @@ class Dataset(HLObject):
             # discards the array information at the top level.
             mtype = h5t.py_create(new_dtype)
 
+            # HDF5 has a bug where if the memory shape has a different rank
+            # than the dataset, the read is very slow
+            mshape = selection.mshape
+            if len(mshape) < len(self.shape):
+                # pad with ones
+                mshape = (1,)*(len(self.shape)-len(mshape)) + mshape
+
             # Perfom the actual read
-            mspace = h5s.create_simple(selection.mshape)
+            mspace = h5s.create_simple(mshape)
             fspace = selection._id
             self.id.read(mspace, fspace, arr, mtype)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git



More information about the debian-science-commits mailing list