[python-hdf5storage] 09/84: Fixed bug in reading empty MATLAB structures.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:57 UTC 2016


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

ghisvail-guest pushed a commit to annotated tag 0.1.10
in repository python-hdf5storage.

commit 5ff55a57f91c12da9d58c9bb0ca8e477745d7682
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Sun Aug 10 18:54:34 2014 -0400

    Fixed bug in reading empty MATLAB structures.
---
 hdf5storage/Marshallers.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hdf5storage/Marshallers.py b/hdf5storage/Marshallers.py
index 9e91b0b..e32e3aa 100644
--- a/hdf5storage/Marshallers.py
+++ b/hdf5storage/Marshallers.py
@@ -984,10 +984,10 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
             # If it is empty and MATLAB_fields is not None, pack it with
             # keys to empty arrays.
             if len(struct_data) == 0 and matlab_fields is not None:
-                struct_data = {k: np.zeros(shape=tuple(),
-                               dtype='object')
-                               for  k in matlab_fields}
-
+                for k in matlab_fields:
+                    struct_data[k] = np.zeros(shape=(0,),
+                                              dtype='object')
+            
             # The dtype for the structured ndarray needs to be
             # composed. This is done by going through each field (in the
             # proper order, if the fields were given, or any order if

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



More information about the debian-science-commits mailing list