[python-hdf5storage] 86/152: Renamed decoders for numpy bytes_ and str_ in utilities.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:37 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 7526cdcb7b99e4cc0650cfb09a1c45344c168108
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Sun Feb 2 22:33:03 2014 -0500

    Renamed decoders for numpy bytes_ and str_ in utilities.
---
 hdf5storage/Marshallers.py |  8 ++++----
 hdf5storage/utilities.py   | 20 ++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/hdf5storage/Marshallers.py b/hdf5storage/Marshallers.py
index be109e4..2fee50d 100644
--- a/hdf5storage/Marshallers.py
+++ b/hdf5storage/Marshallers.py
@@ -686,17 +686,17 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
                 if underlying_type == 'bytes':
                     data = np.bytes_(b'')
                 else:
-                    data = decode_to_numpy_ascii(data, \
+                    data = decode_to_numpy_bytes(data, \
                         length=int(underlying_type[5:])//8)
             elif underlying_type.startswith('str') \
                     or matlab_class == 'char':
                 if underlying_type == 'str':
                     data = np.str_('')
                 elif underlying_type.startswith('str'):
-                    data = decode_to_numpy_unicode(data, \
+                    data = decode_to_numpy_str(data, \
                         length=int(underlying_type[3:])//32)
                 else:
-                    data = decode_to_numpy_unicode(data)
+                    data = decode_to_numpy_str(data)
 
             # If the shape of data and the shape attribute are
             # different but give the same number of elements, then data
@@ -756,7 +756,7 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
             # If it is a 'char' type, the proper conversion to
             # numpy.unicode needs to be done.
             if matlab_class == 'char':
-                data = decode_to_numpy_unicode(data)
+                data = decode_to_numpy_str(data)
 
         # Done adjusting data, so it can be returned.
         return data
diff --git a/hdf5storage/utilities.py b/hdf5storage/utilities.py
index d9d635e..cc531b4 100644
--- a/hdf5storage/utilities.py
+++ b/hdf5storage/utilities.py
@@ -94,7 +94,7 @@ def convert_numpy_str_to_uint16(data):
     See Also
     --------
     convert_numpy_str_to_uint32
-    decode_to_numpy_unicode
+    decode_to_numpy_str
 
     """
     # An empty string should be an empty uint16
@@ -164,7 +164,7 @@ def convert_numpy_str_to_uint32(data):
     See Also
     --------
     convert_numpy_str_to_uint16
-    decode_to_numpy_unicode
+    decode_to_numpy_str
 
     """
     if data.nbytes == 0:
@@ -202,8 +202,8 @@ def decode_to_str(data):
 
     See Also
     --------
-    decode_to_numpy_unicode
-    decode_to_numpy_ascii
+    decode_to_numpy_str
+    decode_to_numpy_bytes
 
     """
     # How the conversion is done depends on the exact  underlying
@@ -238,7 +238,7 @@ def decode_to_str(data):
         return data
 
 
-def decode_to_numpy_unicode(data, length=None):
+def decode_to_numpy_str(data, length=None):
     """ Decodes data to Numpy unicode string (str_).
 
     Decodes `data` to Numpy unicode string (UTF-32), which is
@@ -280,7 +280,7 @@ def decode_to_numpy_unicode(data, length=None):
     See Also
     --------
     decode_to_str
-    decode_to_numpy_ascii
+    decode_to_numpy_bytes
     numpy.str_
 
     """
@@ -323,7 +323,7 @@ def decode_to_numpy_unicode(data, length=None):
         # recursing the scalar value back into this function.
         shape = list(data.shape)
         if len(shape) == 0:
-            return decode_to_numpy_unicode(data[()])
+            return decode_to_numpy_str(data[()])
 
         # As there are more than one element, it gets a bit more
         # complicated. We need to take the subarrays of the specified
@@ -374,7 +374,7 @@ def decode_to_numpy_unicode(data, length=None):
         return data
 
 
-def decode_to_numpy_ascii(data, length=None):
+def decode_to_numpy_bytes(data, length=None):
     """ Decodes data to Numpy ASCII string (bytes_).
 
     Decodes `data` to a  Numpy ASCII string, which is
@@ -414,7 +414,7 @@ def decode_to_numpy_ascii(data, length=None):
     See Also
     --------
     decode_to_str
-    decode_to_numpy_unicode
+    decode_to_numpy_str
     numpy.bytes_
 
     """
@@ -454,7 +454,7 @@ def decode_to_numpy_ascii(data, length=None):
         # recursing the scalar value back into this function.
         shape = list(data.shape)
         if len(shape) == 0:
-            return decode_to_numpy_ascii(data[()])
+            return decode_to_numpy_bytes(data[()])
 
         # As there are more than one element, it gets a bit more
         # complicated. We need to take the subarrays of the specified

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