[python-hdf5storage] 31/152: Fixed bug on writing empty datasets so that Matlab can read them.
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 0.1
in repository python-hdf5storage.
commit 71a2c88e8c188eac270efe03747beb5bd18cf2f8
Author: Freja Nordsiek <fnordsie at gmail.com>
Date: Sun Jan 26 15:42:47 2014 -0500
Fixed bug on writing empty datasets so that Matlab can read them.
---
hdf5storage/Marshallers.py | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/hdf5storage/Marshallers.py b/hdf5storage/Marshallers.py
index 10d8ea5..66aa71e 100644
--- a/hdf5storage/Marshallers.py
+++ b/hdf5storage/Marshallers.py
@@ -383,18 +383,16 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
if options.convert_scalars_to_arrays:
data_to_store = np.atleast_2d(data_to_store)
+ # Reverse the dimension order if that option is set.
+
+ if options.reverse_dimension_order:
+ data_to_store = data_to_store.T
+
# If data is empty, we instead need to store the shape of the
# array if the appropriate option is set.
if options.store_shape_for_empty and data.size == 0:
data_to_store = np.uint64(data.shape)
- if options.convert_scalars_to_arrays:
- data_to_store = np.atleast_2d(data_to_store)
-
- # Reverse the dimension order if that option is set.
-
- if options.reverse_dimension_order:
- data_to_store = data_to_store.T
# If it is a complex type, then it needs to be encoded to have
# the proper complex field names.
--
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