storage:hdf5: convert int/float lists to builtin Python types on load.
authorW. Trevor King <wking@tremily.us>
Wed, 12 Sep 2012 20:52:22 +0000 (16:52 -0400)
committerW. Trevor King <wking@tremily.us>
Wed, 12 Sep 2012 20:52:22 +0000 (16:52 -0400)
commit263932989d12a9e3e98c056a6b67c27d33957be8
tree409218252d594261e4c1d29c8e6df6820996c7b4
parent1468c9b537c5f4b59c96fc06446c69f73022108e
storage:hdf5: convert int/float lists to builtin Python types on load.

This avoids loading a FloatListSetting as a list of `numpy.float64`s,
which lead to problems if you attempted to serialize the resulting
config using `YAML_Storage`:

  Traceback (most recent call last):
    ...
    File ".../h5config/storage/yaml.py", line 140, in _save
      default_flow_style=False)
    File "/usr/lib64/python2.7/site-packages/yaml/__init__.py", line 202, in dump
      return dump_all([data], stream, Dumper=Dumper, **kwds)
    ...
    File "/usr/lib64/python2.7/site-packages/yaml/representer.py", line 247, in represent_undefined
      raise RepresenterError("cannot represent an object: %s" % data)
  yaml.representer.RepresenterError: cannot represent an object: 0.0
h5config/storage/hdf5.py