[python-hdf5storage] 43/152: Gathered all options keywords in high level read/write functions into a **keywords.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:32 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 374e62f9fa31fc1842d349af0fce06cb0c62ca5b
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Sun Jan 26 22:06:53 2014 -0500

    Gathered all options keywords in high level read/write functions into a **keywords.
---
 hdf5storage/core.py | 39 +++++++--------------------------------
 1 file changed, 7 insertions(+), 32 deletions(-)

diff --git a/hdf5storage/core.py b/hdf5storage/core.py
index ae49a03..9761d34 100644
--- a/hdf5storage/core.py
+++ b/hdf5storage/core.py
@@ -646,28 +646,11 @@ class MarshallerCollection(object):
 
 
 def write(filename='data.h5', name='/', data=None,
-          options=None,
-          store_type_information=True, MATLAB_compatible=True,
-          delete_unused_variables=False,
-          convert_scalars_to_arrays=False,
-          reverse_dimension_order=False,
-          convert_strings_to_utf16=False,
-          convert_bools_to_uint8=False,
-          store_shape_for_empty=False,
-          complex_names=('r', 'i'),
-          marshaller_collection=None):
+          options=None, **keywords):
     # Pack the different options into an Options class if an Options was
-    # not given. The easiest way to do this is to get all the arguments
-    # (locals() gets them since they are the only symbols in the local
-    # table at this point) and remove filename, name, and data.
-
+    # not given.
     if not isinstance(options, Options):
-        args = locals().copy()
-        del args['filename']
-        del args['name']
-        del args['data']
-        del args['options']
-        options = Options(**args)
+        options = Options(**keywords)
 
     # Remove double slashes and a non-root trailing slash.
 
@@ -767,20 +750,12 @@ def write(filename='data.h5', name='/', data=None,
             fd.close()
 
 
-def read(filename='data.h5', name='/', options=None,
-         MATLAB_compatible=False, reverse_dimension_order=False,
-         marshaller_collection=None):
+def read(filename='data.h5', name='/',
+         options=None, **keywords):
     # Pack the different options into an Options class if an Options was
-    # not given. The easiest way to do this is to get all the arguments
-    # (locals() gets them since they are the only symbols in the local
-    # table at this point) and remove filename, name, and data.
-
+    # not given.
     if not isinstance(options, Options):
-        args = locals().copy()
-        del args['filename']
-        del args['name']
-        del args['options']
-        options = Options(**args)
+        options = Options(**keywords)
 
     # Remove double slashes and a non-root trailing slash.
 

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