[python-hdf5storage] 01/13: Fixed bug where matlab_compatible was being set to True by default when reading data causing a data transpose before reshaping, corrupting arrays.

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


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

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

commit eeaaa7fa5b579de2dd1007e2d8e0d35edbc80f12
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Sat Feb 13 19:45:07 2016 +0100

    Fixed bug where matlab_compatible was being set to True by default when reading data causing a data transpose before reshaping, corrupting arrays.
---
 hdf5storage/__init__.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/hdf5storage/__init__.py b/hdf5storage/__init__.py
index e00ea12..d75e9f3 100644
--- a/hdf5storage/__init__.py
+++ b/hdf5storage/__init__.py
@@ -1450,9 +1450,14 @@ def reads(paths, filename='data.h5', options=None, **keywords):
 
     """
     # Pack the different options into an Options class if an Options was
-    # not given.
+    # not given. By default, the matlab_compatible option is set to
+    # False. So, if it wasn't passed in the keywords, this needs to be
+    # added to override the default value (True) for a new Options.
     if not isinstance(options, Options):
-        options = Options(**keywords)
+        kw = copy.deepcopy(keywords)
+        if 'matlab_compatible' not in kw:
+            kw['matlab_compatible'] = False
+        options = Options(**kw)
 
     # Process the paths and stuff the group names and target names as
     # tuples into toread.

-- 
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