[python-hdf5storage] 08/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 713276d504af05e5c71e3d8af9bc4456852d3b58
Author: Freja Nordsiek <fnordsie at gmail.com>
Date: Sun Aug 10 18:42:43 2014 -0400
Fixed bug in reading empty MATLAB structures.
---
hdf5storage/Marshallers.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/hdf5storage/Marshallers.py b/hdf5storage/Marshallers.py
index a2f9144..9e91b0b 100644
--- a/hdf5storage/Marshallers.py
+++ b/hdf5storage/Marshallers.py
@@ -971,7 +971,7 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
grp[name], k, options)
except:
pass
-
+
# If it isn't multi element, we need to pack all the values
# in struct_array inside of numpy.object_'s so that the code
# after this that depends on this will work.
@@ -1161,10 +1161,11 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
# did most of the work except handling empties, array
# dimension order, and string conversion.
- # If it is empty ('MATLAB_empty' set to 1), then the shape
- # information is stored in data and we need to set data to
- # the empty array of the proper type.
- if matlab_empty == 1:
+ # If it is empty ('MATLAB_empty' set to 1) and
+ # 'MATLAB_fields' is not present, then the shape information
+ # is stored in data and we need to set data to the empty
+ # array of the proper type.
+ if matlab_empty == 1 and matlab_fields is None:
data = np.zeros(tuple(np.uint64(data)), \
dtype=self.__MATLAB_classes_reverse[matlab_class])
--
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