[python-hdf5storage] 57/152: Dropped the C in all the CPython parts of attribute names.

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:34 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 5bc85e031b26ada3e8fcb17d4b175dc32de06728
Author: Freja Nordsiek <fnordsie at gmail.com>
Date:   Tue Jan 28 23:45:19 2014 -0500

    Dropped the C in all the CPython parts of attribute names.
---
 doc/source/hdf5storage.Marshallers.rst |  72 +++++++++----------
 hdf5storage/Marshallers.py             | 122 ++++++++++++++++-----------------
 hdf5storage/__init__.py                |   8 +--
 hdf5storage/lowlevel.py                |   2 +-
 4 files changed, 102 insertions(+), 102 deletions(-)

diff --git a/doc/source/hdf5storage.Marshallers.rst b/doc/source/hdf5storage.Marshallers.rst
index 25d6ce2..feca8ee 100644
--- a/doc/source/hdf5storage.Marshallers.rst
+++ b/doc/source/hdf5storage.Marshallers.rst
@@ -13,8 +13,8 @@ TypeMarshaller
    :members: get_type_string, read, write, write_metadata 
    :show-inheritance:
 
-   .. autoinstanceattribute:: TypeMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type'}
+   .. autoinstanceattribute:: TypeMarshaller.python_attributes
+      :annotation: = {'Python.Type'}
 
    .. autoinstanceattribute:: TypeMarshaller.matlab_attributes
       :annotation: = {'H5PATH'}
@@ -22,7 +22,7 @@ TypeMarshaller
    .. autoinstanceattribute:: TypeMarshaller.types
       :annotation: = []
 
-   .. autoinstanceattribute:: TypeMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: TypeMarshaller.python_type_strings
       :annotation: = []
 
    .. autoinstanceattribute:: TypeMarshaller.matlab_classes
@@ -36,10 +36,10 @@ NumpyScalarArrayMarshaller
    :members: read, write, write_metadata 
    :show-inheritance:
 
-   .. autoinstanceattribute:: NumpyScalarArrayMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type', 'CPython.Shape', 'CPython.Empty',
-		      'CPython.numpy.UnderlyingType',
-                      'CPython.numpy.Container'}
+   .. autoinstanceattribute:: NumpyScalarArrayMarshaller.python_attributes
+      :annotation: = {'Python.Type', 'Python.Shape', 'Python.Empty',
+		      'Python.numpy.UnderlyingType',
+                      'Python.numpy.Container'}
 
    .. autoinstanceattribute:: NumpyScalarArrayMarshaller.matlab_attributes
       :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty',
@@ -54,7 +54,7 @@ NumpyScalarArrayMarshaller
                       np.complex64, np.complex128,
                       np.bytes_, np.str_, np.object_]
 
-   .. autoinstanceattribute:: NumpyScalarArrayMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: NumpyScalarArrayMarshaller.python_type_strings
       :annotation: = ['numpy.ndarray', 'numpy.matrix',
                       'numpy.bool_', 'numpy.uint8', 'numpy.uint16',
                       'numpy.uint32', 'numpy.uint64', 'numpy.int8',
@@ -76,10 +76,10 @@ PythonScalarMarshaller
    :members: read, write
    :show-inheritance:
 
-   .. autoinstanceattribute:: PythonScalarMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type', 'CPython.Shape', 'CPython.Empty',
-		      'CPython.numpy.UnderlyingType',
-                      'CPython.numpy.Container'}
+   .. autoinstanceattribute:: PythonScalarMarshaller.python_attributes
+      :annotation: = {'Python.Type', 'Python.Shape', 'Python.Empty',
+		      'Python.numpy.UnderlyingType',
+                      'Python.numpy.Container'}
 
    .. autoinstanceattribute:: PythonScalarMarshaller.matlab_attributes
       :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty',
@@ -88,7 +88,7 @@ PythonScalarMarshaller
    .. autoinstanceattribute:: PythonScalarMarshaller.types
       :annotation: = [bool, int, float, complex]
 
-   .. autoinstanceattribute:: PythonScalarMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: PythonScalarMarshaller.python_type_strings
       :annotation: = ['bool', 'int', 'float', 'complex']
 
    .. autoinstanceattribute:: PythonScalarMarshaller.matlab_classes
@@ -102,10 +102,10 @@ PythonStringMarshaller
    :members: read, write
    :show-inheritance:
 
-   .. autoinstanceattribute:: PythonStringMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type', 'CPython.Shape', 'CPython.Empty',
-		      'CPython.numpy.UnderlyingType',
-                      'CPython.numpy.Container'}
+   .. autoinstanceattribute:: PythonStringMarshaller.python_attributes
+      :annotation: = {'Python.Type', 'Python.Shape', 'Python.Empty',
+		      'Python.numpy.UnderlyingType',
+                      'Python.numpy.Container'}
 
    .. autoinstanceattribute:: PythonStringMarshaller.matlab_attributes
       :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty',
@@ -114,7 +114,7 @@ PythonStringMarshaller
    .. autoinstanceattribute:: PythonStringMarshaller.types
       :annotation: = [str, bytes, bytearray]
 
-   .. autoinstanceattribute:: PythonStringMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: PythonStringMarshaller.python_type_strings
       :annotation: = ['str', 'bytes', 'bytearray']
 
    .. autoinstanceattribute:: PythonStringMarshaller.matlab_classes
@@ -128,10 +128,10 @@ PythonNoneMarshaller
    :members: read, write
    :show-inheritance:
 
-   .. autoinstanceattribute:: PythonNoneMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type', 'CPython.Shape', 'CPython.Empty',
-		      'CPython.numpy.UnderlyingType',
-                      'CPython.numpy.Container'}
+   .. autoinstanceattribute:: PythonNoneMarshaller.python_attributes
+      :annotation: = {'Python.Type', 'Python.Shape', 'Python.Empty',
+		      'Python.numpy.UnderlyingType',
+                      'Python.numpy.Container'}
 
    .. autoinstanceattribute:: PythonNoneMarshaller.matlab_attributes
       :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty',
@@ -140,7 +140,7 @@ PythonNoneMarshaller
    .. autoinstanceattribute:: PythonNoneMarshaller.types
       :annotation: = [builtins.NoneType]
 
-   .. autoinstanceattribute:: PythonNoneMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: PythonNoneMarshaller.python_type_strings
       :annotation: = ['builtins.NoneType']
 
    .. autoinstanceattribute:: PythonNoneMarshaller.matlab_classes
@@ -154,8 +154,8 @@ PythonDictMarshaller
    :members: read, write, write_metadata
    :show-inheritance:
 
-   .. autoinstanceattribute:: PythonDictMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type', 'CPython.Empty'}
+   .. autoinstanceattribute:: PythonDictMarshaller.python_attributes
+      :annotation: = {'Python.Type', 'Python.Empty'}
 
    .. autoinstanceattribute:: PythonDictMarshaller.matlab_attributes
       :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty'}
@@ -163,7 +163,7 @@ PythonDictMarshaller
    .. autoinstanceattribute:: PythonDictMarshaller.types
       :annotation: = [dict]
 
-   .. autoinstanceattribute:: PythonDictMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: PythonDictMarshaller.python_type_strings
       :annotation: = ['dict']
 
    .. autoinstanceattribute:: PythonDictMarshaller.matlab_classes
@@ -177,10 +177,10 @@ PythonListMarshaller
    :members: read, write
    :show-inheritance:
 
-   .. autoinstanceattribute:: PythonListMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type', 'CPython.Shape', 'CPython.Empty',
-		      'CPython.numpy.UnderlyingType',
-                      'CPython.numpy.Container'}
+   .. autoinstanceattribute:: PythonListMarshaller.python_attributes
+      :annotation: = {'Python.Type', 'Python.Shape', 'Python.Empty',
+		      'Python.numpy.UnderlyingType',
+                      'Python.numpy.Container'}
 
    .. autoinstanceattribute:: PythonListMarshaller.matlab_attributes
       :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty',
@@ -189,7 +189,7 @@ PythonListMarshaller
    .. autoinstanceattribute:: PythonListMarshaller.types
       :annotation: = [list]
 
-   .. autoinstanceattribute:: PythonListMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: PythonListMarshaller.python_type_strings
       :annotation: = ['list']
 
    .. autoinstanceattribute:: PythonListMarshaller.matlab_classes
@@ -203,10 +203,10 @@ PythonTupleSetDequeMarshaller
    :members: read, write
    :show-inheritance:
 
-   .. autoinstanceattribute:: PythonTupleSetDequeMarshaller.cpython_attributes
-      :annotation: = {'CPython.Type', 'CPython.Shape', 'CPython.Empty',
-		      'CPython.numpy.UnderlyingType',
-                      'CPython.numpy.Container'}
+   .. autoinstanceattribute:: PythonTupleSetDequeMarshaller.python_attributes
+      :annotation: = {'Python.Type', 'Python.Shape', 'Python.Empty',
+		      'Python.numpy.UnderlyingType',
+                      'Python.numpy.Container'}
 
    .. autoinstanceattribute:: PythonTupleSetDequeMarshaller.matlab_attributes
       :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty',
@@ -215,7 +215,7 @@ PythonTupleSetDequeMarshaller
    .. autoinstanceattribute:: PythonTupleSetDequeMarshaller.types
       :annotation: = [tuple, set, frozenset, collections.deque]
 
-   .. autoinstanceattribute:: PythonTupleSetDequeMarshaller.cpython_type_strings
+   .. autoinstanceattribute:: PythonTupleSetDequeMarshaller.python_type_strings
       :annotation: = ['tuple', 'set', 'frozenset', 'collections.deque']
 
    .. autoinstanceattribute:: PythonTupleSetDequeMarshaller.matlab_classes
diff --git a/hdf5storage/Marshallers.py b/hdf5storage/Marshallers.py
index c94fb1e..5cd012f 100644
--- a/hdf5storage/Marshallers.py
+++ b/hdf5storage/Marshallers.py
@@ -60,13 +60,13 @@ class TypeMarshaller(object):
 
     Attributes
     ----------
-    cpython_attributes : set of str
+    python_attributes : set of str
         Attributes used to store type information.
     matlab_attributes : set of str
         Attributes used for MATLAB compatibility.
     types : list of types
         Types the marshaller can work on.
-    cpython_type_strings : list of str
+    python_type_strings : list of str
         Type strings of readable types.
     matlab_classes : list of str
         Readable MATLAB classes.
@@ -88,7 +88,7 @@ class TypeMarshaller(object):
         #:
         #: ``set`` of attribute names the marshaller uses when
         #: an ``Option.store_type_information`` is ``True``.
-        self.cpython_attributes = {'CPython.Type'}
+        self.python_attributes = {'Python.Type'}
 
         #: Attributes used for MATLAB compatibility.
         #:
@@ -112,9 +112,9 @@ class TypeMarshaller(object):
         #: list of str
         #:
         #: ``list`` of the ``str`` that the marshaller would put in the
-        #: HDF5 attribute 'CPython.Type' to identify the Python type to be
+        #: HDF5 attribute 'Python.Type' to identify the Python type to be
         #: able to read it back correctly. Default value is ``[]``.
-        self.cpython_type_strings = []
+        self.python_type_strings = []
 
         #: MATLAB class strings of readable types.
         #:
@@ -128,7 +128,7 @@ class TypeMarshaller(object):
         """ Gets type string.
 
         Finds the type string for 'data' contained in
-        ``cpython_type_strings`` using its ``type``. Non-``None``
+        ``python_type_strings`` using its ``type``. Non-``None``
         'type_string` overrides whatever type string is looked up.
         The override makes it easier for subclasses to convert something
         that the parent marshaller can write to disk but still put the
@@ -157,7 +157,7 @@ class TypeMarshaller(object):
             return type_string
         else:
             i = self.types.index(type(data))
-            return self.cpython_type_strings[i]
+            return self.python_type_strings[i]
 
     def write(self, f, grp, name, data, type_string, options):
         """ Writes an object's metadata to file.
@@ -226,8 +226,8 @@ class TypeMarshaller(object):
 
         Notes
         -----
-        The attribute 'CPython.Type' is set to the type string. All H5PY
-        Attributes not in ``cpython_attributes`` and/or
+        The attribute 'Python.Type' is set to the type string. All H5PY
+        Attributes not in ``python_attributes`` and/or
         ``matlab_attributes`` (depending on the attributes of 'options')
         are deleted. These are needed functions for writting essentially
         any Python object, so subclasses should probably call the
@@ -243,16 +243,16 @@ class TypeMarshaller(object):
         # The metadata that is written depends on the format.
 
         if options.store_type_information:
-            set_attribute_string(grp[name], 'CPython.Type', type_string)
+            set_attribute_string(grp[name], 'Python.Type', type_string)
 
         # If we are not storing type information or doing MATLAB
-        # compatibility, then attributes not in the cpython and/or
+        # compatibility, then attributes not in the python and/or
         # MATLAB lists need to be removed.
 
         attributes_used = set()
 
         if options.store_type_information:
-            attributes_used |= self.cpython_attributes
+            attributes_used |= self.python_attributes
 
         if options.MATLAB_compatible:
             attributes_used |= self.matlab_attributes
@@ -304,9 +304,9 @@ class TypeMarshaller(object):
 class NumpyScalarArrayMarshaller(TypeMarshaller):
     def __init__(self):
         TypeMarshaller.__init__(self)
-        self.cpython_attributes |= {'CPython.Shape', 'CPython.Empty',
-                                    'CPython.numpy.UnderlyingType',
-                                    'CPython.numpy.Container'}
+        self.python_attributes |= {'Python.Shape', 'Python.Empty',
+                                   'Python.numpy.UnderlyingType',
+                                   'Python.numpy.Container'}
         self.matlab_attributes |= {'MATLAB_class', 'MATLAB_empty',
                                    'MATLAB_int_decode'}
         self.types = [np.ndarray, np.matrix,
@@ -316,18 +316,18 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
                       np.float16, np.float32, np.float64,
                       np.complex64, np.complex128,
                       np.bytes_, np.str_, np.object_]
-        self.cpython_type_strings = ['numpy.ndarray', 'numpy.matrix',
-                                     'numpy.bool_',
-                                     'numpy.uint8', 'numpy.uint16',
-                                     'numpy.uint32', 'numpy.uint64',
-                                     'numpy.int8', 'numpy.int16',
-                                     'numpy.int32', 'numpy.int64',
-                                     'numpy.float16', 'numpy.float32',
-                                     'numpy.float64',
-                                     'numpy.complex64',
-                                     'numpy.complex128',
-                                     'numpy.bytes_', 'numpy.str_',
-                                     'numpy.object_']
+        self.python_type_strings = ['numpy.ndarray', 'numpy.matrix',
+                                    'numpy.bool_',
+                                    'numpy.uint8', 'numpy.uint16',
+                                    'numpy.uint32', 'numpy.uint64',
+                                    'numpy.int8', 'numpy.int16',
+                                    'numpy.int32', 'numpy.int64',
+                                    'numpy.float16', 'numpy.float32',
+                                    'numpy.float64',
+                                    'numpy.complex64',
+                                    'numpy.complex128',
+                                    'numpy.bytes_', 'numpy.str_',
+                                    'numpy.object_']
 
         # If we are storing in MATLAB format, we will need to be able to
         # set the MATLAB_class attribute. The different numpy types just
@@ -512,10 +512,10 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
         # 'matrix') need to be stored.
 
         if options.store_type_information:
-            set_attribute(grp[name], 'CPython.Shape',
+            set_attribute(grp[name], 'Python.Shape',
                           np.uint64(data.shape))
             set_attribute_string(grp[name],
-                                 'CPython.numpy.UnderlyingType',
+                                 'Python.numpy.UnderlyingType',
                                  data.dtype.name)
             if isinstance(data, np.matrix):
                 container = 'matrix'
@@ -523,10 +523,10 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
                 container = 'ndarray'
             else:
                 container = 'scalar'
-            set_attribute_string(grp[name], 'CPython.numpy.Container',
+            set_attribute_string(grp[name], 'Python.numpy.Container',
                                  container)
 
-        # If data is empty, we need to set the CPython.Empty and
+        # If data is empty, we need to set the Python.Empty and
         # MATLAB_empty attributes to 1 if we are storing type info or
         # making it MATLAB compatible. Otherwise, no empty attribute is
         # set and existing ones must be deleted.
@@ -535,17 +535,17 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
                 or data.dtype.type == np.str_)
                 and data.nbytes == 0):
             if options.store_type_information:
-                set_attribute(grp[name], 'CPython.Empty',
+                set_attribute(grp[name], 'Python.Empty',
                                           np.uint8(1))
             else:
-                del_attribute(grp[name], 'CPython.Empty')
+                del_attribute(grp[name], 'Python.Empty')
             if options.MATLAB_compatible:
                 set_attribute(grp[name], 'MATLAB_empty',
                                           np.uint8(1))
             else:
                 del_attribute(grp[name], 'MATLAB_empty')
         else:
-            del_attribute(grp[name], 'CPython.Empty')
+            del_attribute(grp[name], 'Python.Empty')
             del_attribute(grp[name], 'MATLAB_empty')
 
         # If we are making it MATLAB compatible, the MATLAB_class
@@ -582,13 +582,13 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
 
         # Get the different attributes this marshaller uses.
 
-        type_string = get_attribute_string(grp[name], 'CPython.Type')
+        type_string = get_attribute_string(grp[name], 'Python.Type')
         underlying_type = get_attribute_string(grp[name], \
-            'CPython.numpy.UnderlyingType')
-        shape = get_attribute(grp[name], 'CPython.Shape')
+            'Python.numpy.UnderlyingType')
+        shape = get_attribute(grp[name], 'Python.Shape')
         container = get_attribute_string(grp[name], \
-            'CPython.numpy.Container')
-        cpython_empty = get_attribute(grp[name], 'CPython.Empty')
+            'Python.numpy.Container')
+        python_empty = get_attribute(grp[name], 'Python.Empty')
 
         matlab_class = get_attribute_string(grp[name], 'MATLAB_class')
         matlab_empty = get_attribute(grp[name], 'MATLAB_empty')
@@ -625,13 +625,13 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
 
         if type_string is not None and underlying_type is not None and \
                 shape is not None:
-            # If it is empty ('CPython.Empty' set to 1), then the shape
+            # If it is empty ('Python.Empty' set to 1), then the shape
             # information is stored in data and we need to set data to
             # the empty array of the proper type (in underlying_type)
             # and the given shape. If we are going to transpose it
             # later, we need to transpose it now so that it still keeps
             # the right shape.
-            if cpython_empty == 1:
+            if python_empty == 1:
                 data = np.zeros(tuple(shape),
                                 dtype=underlying_type)
                 if matlab_class is not None or \
@@ -669,7 +669,7 @@ class NumpyScalarArrayMarshaller(TypeMarshaller):
             # manually set to '' and b'' or there will be problems.
             if container == 'scalar':
                 data = data[()]
-                if cpython_empty == 1:
+                if python_empty == 1:
                     if underlying_type == 'bytes':
                         data = np.bytes_(b'')
                     elif underlying_type == 'str':
@@ -727,7 +727,7 @@ class PythonScalarMarshaller(NumpyScalarArrayMarshaller):
     def __init__(self):
         NumpyScalarArrayMarshaller.__init__(self)
         self.types = [bool, int, float, complex]
-        self.cpython_type_strings = ['bool', 'int', 'float', 'complex']
+        self.python_type_strings = ['bool', 'int', 'float', 'complex']
         # As the parent class already has MATLAB strings handled, there
         # are no MATLAB classes that this marshaller should be used for.
         self.matlab_classes = []
@@ -755,9 +755,9 @@ class PythonScalarMarshaller(NumpyScalarArrayMarshaller):
         # type (just look up the entry in types). As it might be
         # returned as an ndarray, it needs to be run through
         # np.asscalar.
-        type_string = get_attribute_string(grp[name], 'CPython.Type')
-        if type_string in self.cpython_type_strings:
-            tp = self.types[self.cpython_type_strings.index(
+        type_string = get_attribute_string(grp[name], 'Python.Type')
+        if type_string in self.python_type_strings:
+            tp = self.types[self.python_type_strings.index(
                             type_string)]
             return tp(np.asscalar(data))
         else:
@@ -769,7 +769,7 @@ class PythonStringMarshaller(NumpyScalarArrayMarshaller):
     def __init__(self):
         NumpyScalarArrayMarshaller.__init__(self)
         self.types = [str, bytes, bytearray]
-        self.cpython_type_strings = ['str', 'bytes', 'bytearray']
+        self.python_type_strings = ['str', 'bytes', 'bytearray']
         # As the parent class already has MATLAB strings handled, there
         # are no MATLAB classes that this marshaller should be used for.
         self.matlab_classes = []
@@ -795,7 +795,7 @@ class PythonStringMarshaller(NumpyScalarArrayMarshaller):
         # The type string determines how to convert it back to a Python
         # type (just look up the entry in types). Otherwise, return it
         # as is.
-        type_string = get_attribute_string(grp[name], 'CPython.Type')
+        type_string = get_attribute_string(grp[name], 'Python.Type')
         if type_string == 'str':
             if isinstance(data, np.ndarray):
                 return data.tostring().decode()
@@ -813,7 +813,7 @@ class PythonNoneMarshaller(NumpyScalarArrayMarshaller):
     def __init__(self):
         NumpyScalarArrayMarshaller.__init__(self)
         self.types = [type(None)]
-        self.cpython_type_strings = ['builtins.NoneType']
+        self.python_type_strings = ['builtins.NoneType']
         # None corresponds to no MATLAB class.
         self.matlab_classes = []
 
@@ -835,10 +835,10 @@ class PythonNoneMarshaller(NumpyScalarArrayMarshaller):
 class PythonDictMarshaller(TypeMarshaller):
     def __init__(self):
         TypeMarshaller.__init__(self)
-        self.cpython_attributes |= {'CPython.Empty'}
+        self.python_attributes |= {'Python.Empty'}
         self.matlab_attributes |= {'MATLAB_class', 'MATLAB_empty'}
         self.types = [dict]
-        self.cpython_type_strings = ['dict']
+        self.python_type_strings = ['dict']
         self.__MATLAB_classes = {dict: 'struct'}
         # Set matlab_classes to the supported classes (the values).
         self.matlab_classes = list(self.__MATLAB_classes.values())
@@ -893,24 +893,24 @@ class PythonDictMarshaller(TypeMarshaller):
                                       type_string, options)
 
         # If data is empty and we are supposed to store shape info for
-        # empty data, we need to set the CPython.Empty and MATLAB_empty
+        # empty data, we need to set the Python.Empty and MATLAB_empty
         # attributes to 1 if we are storing type info or making it
         # MATLAB compatible. Otherwise, no empty attribute is set and
         # existing ones must be deleted.
 
         if options.store_shape_for_empty and len(data) == 0:
             if options.store_type_information:
-                set_attribute(grp[name], 'CPython.Empty',
+                set_attribute(grp[name], 'Python.Empty',
                                           np.uint8(1))
             else:
-                del_attribute(grp[name], 'CPython.Empty')
+                del_attribute(grp[name], 'Python.Empty')
             if options.MATLAB_compatible:
                 set_attribute(grp[name], 'MATLAB_empty',
                                           np.uint8(1))
             else:
                 del_attribute(grp[name], 'MATLAB_empty')
         else:
-            del_attribute(grp[name], 'CPython.Empty')
+            del_attribute(grp[name], 'Python.Empty')
             del_attribute(grp[name], 'MATLAB_empty')
 
         # If we are making it MATLAB compatible, the MATLAB_class
@@ -966,7 +966,7 @@ class PythonListMarshaller(NumpyScalarArrayMarshaller):
     def __init__(self):
         NumpyScalarArrayMarshaller.__init__(self)
         self.types = [list]
-        self.cpython_type_strings = ['list']
+        self.python_type_strings = ['list']
         # As the parent class already has MATLAB strings handled, there
         # are no MATLAB classes that this marshaller should be used for.
         self.matlab_classes = []
@@ -998,8 +998,8 @@ class PythonTupleSetDequeMarshaller(PythonListMarshaller):
     def __init__(self):
         PythonListMarshaller.__init__(self)
         self.types = [tuple, set, frozenset, collections.deque]
-        self.cpython_type_strings = ['tuple', 'set', 'frozenset',
-                                     'collections.deque']
+        self.python_type_strings = ['tuple', 'set', 'frozenset',
+                                    'collections.deque']
         # As the parent class already has MATLAB strings handled, there
         # are no MATLAB classes that this marshaller should be used for.
         self.matlab_classes = []
@@ -1022,9 +1022,9 @@ class PythonTupleSetDequeMarshaller(PythonListMarshaller):
 
         # The type string determines how to convert it back to a Python
         # type (just look up the entry in types).
-        type_string = get_attribute_string(grp[name], 'CPython.Type')
-        if type_string in self.cpython_type_strings:
-            tp = self.types[self.cpython_type_strings.index(
+        type_string = get_attribute_string(grp[name], 'Python.Type')
+        if type_string in self.python_type_strings:
+            tp = self.types[self.python_type_strings.index(
                             type_string)]
             return tp(data)
         else:
diff --git a/hdf5storage/__init__.py b/hdf5storage/__init__.py
index 349cf62..16862c8 100644
--- a/hdf5storage/__init__.py
+++ b/hdf5storage/__init__.py
@@ -676,11 +676,11 @@ class MarshallerCollection(object):
 
         # The equivalent one to read data types given type strings needs
         # to be created from it. Basically, we have to make the key be
-        # the cpython_type_string from it.
+        # the python_type_string from it.
 
         self._type_strings = {type_string: m for key, m in
                               self._types.items() for type_string in
-                              m.cpython_type_strings}
+                              m.python_type_strings}
 
         # The equivalent one to read data types given MATLAB class
         # strings needs to be created from it. Basically, we have to
@@ -789,7 +789,7 @@ class MarshallerCollection(object):
 
         See Also
         --------
-        hdf5storage.Marshallers.TypeMarshaller.cpython_type_strings
+        hdf5storage.Marshallers.TypeMarshaller.python_type_strings
 
         """
         if type_string in self._type_strings:
@@ -816,7 +816,7 @@ class MarshallerCollection(object):
 
         See Also
         --------
-        hdf5storage.Marshallers.TypeMarshaller.cpython_type_strings
+        hdf5storage.Marshallers.TypeMarshaller.python_type_strings
 
         """
         if matlab_class in self._matlab_classes:
diff --git a/hdf5storage/lowlevel.py b/hdf5storage/lowlevel.py
index a6259cf..baf3832 100644
--- a/hdf5storage/lowlevel.py
+++ b/hdf5storage/lowlevel.py
@@ -135,7 +135,7 @@ def read_data(f, grp, name, options):
 
     # Get the different attributes that can be used to identify they
     # type, which are the type string and the MATLAB class.
-    type_string = get_attribute_string(grp[name], 'CPython.Type')
+    type_string = get_attribute_string(grp[name], 'Python.Type')
     matlab_class = get_attribute_string(grp[name], 'MATLAB_class')
 
     # If the type_string is present, get the marshaller for it. If it is

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