[python-hdf5storage] 93/152: Renamed the convert_scalars_to_arrays option to make_atleast_2d.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:38 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 e7ca1641a783d52e49314fe5546ea00ace2143a7
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Mon Feb 3 00:17:27 2014 -0500

    Renamed the convert_scalars_to_arrays option to make_atleast_2d.
---
 hdf5storage/Marshallers.py |  2 +-
 hdf5storage/__init__.py    | 36 ++++++++++++++++++------------------
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/hdf5storage/Marshallers.py b/hdf5storage/Marshallers.py
index 86234e6..528ec31 100644
--- a/hdf5storage/Marshallers.py
+++ b/hdf5storage/Marshallers.py
@@ -422,7 +422,7 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
         # arrays, an option determines whether they become row or column
         # vectors.
 
-        if options.convert_scalars_to_arrays:
+        if options.make_atleast_2d:
             new_data = np.atleast_2d(data_to_store)
             if len(data_to_store.shape) == 1 \
                     and options.oned_as == 'column':
diff --git a/hdf5storage/__init__.py b/hdf5storage/__init__.py
index 81576a4..ddca734 100644
--- a/hdf5storage/__init__.py
+++ b/hdf5storage/__init__.py
@@ -201,7 +201,7 @@ class Options(object):
     attribute                     value
     ============================  ====================
     delete_unused_variables       ``True``
-    convert_scalars_to_arrays     ``True``
+    make_atleast_2d               ``True``
     convert_numpy_bytes_to_utf16  ``True``
     convert_numpy_str_to_utf16    ``True``
     convert_bools_to_uint8        ``True``
@@ -223,7 +223,7 @@ class Options(object):
         See Attributes.
     delete_unused_variables:  : bool, optional
         See Attributes.
-    convert_scalars_to_arrays : bool, optional
+    make_atleast_2d : bool, optional
         See Attributes.
     convert_numpy_bytes_to_utf16 : bool, optional
         See Attributes.
@@ -249,7 +249,7 @@ class Options(object):
     store_type_information : bool
     matlab_compatible : bool
     delete_unused_variables : bool
-    convert_scalars_to_arrays : bool
+    make_atleast_2d : bool
     convert_numpy_bytes_to_utf16 : bool
     convert_numpy_str_to_utf16 : bool
     convert_bools_to_uint8 : bool
@@ -269,7 +269,7 @@ class Options(object):
     def __init__(self, store_type_information=True,
                  matlab_compatible=True,
                  delete_unused_variables=False,
-                 convert_scalars_to_arrays=False,
+                 make_atleast_2d=False,
                  convert_numpy_bytes_to_utf16=False,
                  convert_numpy_str_to_utf16=False,
                  convert_bools_to_uint8=False,
@@ -283,7 +283,7 @@ class Options(object):
 
         self._store_type_information = True
         self._delete_unused_variables = False
-        self._convert_scalars_to_arrays = False
+        self._make_atleast_2d = False
         self._convert_numpy_bytes_to_utf16 = False
         self._convert_numpy_str_to_utf16 = False
         self._convert_bools_to_uint8 = False
@@ -300,7 +300,7 @@ class Options(object):
 
         self.store_type_information = store_type_information
         self.delete_unused_variables = delete_unused_variables
-        self.convert_scalars_to_arrays = convert_scalars_to_arrays
+        self.make_atleast_2d = make_atleast_2d
         self.convert_numpy_bytes_to_utf16 = convert_numpy_bytes_to_utf16
         self.convert_numpy_str_to_utf16 = convert_numpy_str_to_utf16
         self.convert_bools_to_uint8 = convert_bools_to_uint8
@@ -366,7 +366,7 @@ class Options(object):
         attribute                     value
         ============================  ====================
         delete_unused_variables       ``True``
-        convert_scalars_to_arrays     ``True``
+        make_atleast_2d               ``True``
         convert_numpy_bytes_to_utf16  ``True``
         convert_numpy_str_to_utf16    ``True``
         convert_bools_to_uint8        ``True``
@@ -391,7 +391,7 @@ class Options(object):
             self._matlab_compatible = value
             if value:
                 self._delete_unused_variables = True
-                self._convert_scalars_to_arrays = True
+                self._make_atleast_2d = True
                 self._convert_numpy_bytes_to_utf16 = True
                 self._convert_numpy_str_to_utf16 = True
                 self._convert_bools_to_uint8 = True
@@ -425,7 +425,7 @@ class Options(object):
             self._matlab_compatible = False
 
     @property
-    def convert_scalars_to_arrays(self):
+    def make_atleast_2d(self):
         """ Whether or not to convert scalar types to 2D arrays.
 
         bool
@@ -443,15 +443,15 @@ class Options(object):
         oned_as
 
         """
-        return self._convert_scalars_to_arrays
+        return self._make_atleast_2d
 
-    @convert_scalars_to_arrays.setter
-    def convert_scalars_to_arrays(self, value):
+    @make_atleast_2d.setter
+    def make_atleast_2d(self, value):
         # Check that it is a bool, and then set it. If it is false, we
         # are not doing MATLAB compatible formatting.
         if isinstance(value, bool):
-            self._convert_scalars_to_arrays = value
-        if not self._convert_scalars_to_arrays:
+            self._make_atleast_2d = value
+        if not self._make_atleast_2d:
             self._matlab_compatible = False
 
     @property
@@ -666,13 +666,13 @@ class Options(object):
 
         {'row', 'column'}
 
-        When the ``convert_scalars_to_arrays`` option is set (set
-        implicitly by doing MATLAB compatibility), this option controls
-        whether 1D arrays become row vectors or column vectors.
+        When the ``make_atleast_2d`` option is set (set implicitly by
+        doing MATLAB compatibility), this option controls whether 1D
+        arrays become row vectors or column vectors.
 
         See Also
         --------
-        convert_scalars_to_arrays
+        make_atleast_2d
 
         """
         return self._oned_as

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