[python-hdf5storage] 131/152: Fixed a bug where a dict with no members was marked with metadata as a zero sized struct, instead of one with no fields.
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:24:41 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 2c059a09a93fa5c4d13d452a65d807159b5df744
Author: Freja Nordsiek <fnordsie at gmail.com>
Date: Sat Feb 15 18:31:11 2014 -0500
Fixed a bug where a dict with no members was marked with metadata as a zero sized struct, instead of one with no fields.
---
doc/source/hdf5storage.Marshallers.rst | 4 ++--
hdf5storage/Marshallers.py | 25 ++-----------------------
2 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/doc/source/hdf5storage.Marshallers.rst b/doc/source/hdf5storage.Marshallers.rst
index 6b6e997..f51cb63 100644
--- a/doc/source/hdf5storage.Marshallers.rst
+++ b/doc/source/hdf5storage.Marshallers.rst
@@ -183,10 +183,10 @@ PythonDictMarshaller
:show-inheritance:
.. autoinstanceattribute:: PythonDictMarshaller.python_attributes
- :annotation: = {'Python.Type', 'Python.Empty', 'Python.Fields'}
+ :annotation: = {'Python.Type', 'Python.Fields'}
.. autoinstanceattribute:: PythonDictMarshaller.matlab_attributes
- :annotation: = {'H5PATH', 'MATLAB_class', 'MATLAB_empty'}
+ :annotation: = {'H5PATH', 'MATLAB_class'}
.. autoinstanceattribute:: PythonDictMarshaller.types
:annotation: = [dict]
diff --git a/hdf5storage/Marshallers.py b/hdf5storage/Marshallers.py
index 89c1b6b..460d271 100644
--- a/hdf5storage/Marshallers.py
+++ b/hdf5storage/Marshallers.py
@@ -1224,8 +1224,8 @@ class PythonNoneMarshaller(NumpyScalarArrayMarshaller):
class PythonDictMarshaller(TypeMarshaller):
def __init__(self):
TypeMarshaller.__init__(self)
- self.python_attributes |= {'Python.Empty', 'Python.Fields'}
- self.matlab_attributes |= {'MATLAB_class', 'MATLAB_empty'}
+ self.python_attributes |= {'Python.Fields'}
+ self.matlab_attributes |= {'MATLAB_class'}
self.types = [dict]
self.python_type_strings = ['dict']
self.__MATLAB_classes = {dict: 'struct'}
@@ -1283,27 +1283,6 @@ class PythonDictMarshaller(TypeMarshaller):
TypeMarshaller.write_metadata(self, f, grp, name, data,
type_string, options)
- # If data is empty and we are supposed to store shape info for
- # 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_python_metadata:
- set_attribute(grp[name], 'Python.Empty',
- np.uint8(1))
- else:
- 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], 'Python.Empty')
- del_attribute(grp[name], 'MATLAB_empty')
-
# If we are storing python metadata, we need to set the
# 'Python.Fields' Attribute to be all the keys. They will be
# sorted for convenience
--
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