-
assigned issue to
HDF5File attributes are broken (from python)
Issue #374
resolved
Only tested this from python. Reproduce:
from dolfin import *
hdf_file = HDF5File(mpi_comm_world(), "myfile.h5", "w")
x = Vector(mpi_comm_world(), 123)
vecname = "/a_vector"
hdf_file.write(x, vecname)
attr = hdf_file.attributes(vecname)
assert attr.exists("name") == False
attr["name"] = "John"
assert attr.exists("name") == True
assert attr.get("name") == "John" # Crash
# output:
"""
*** Error: Unable to complete call to function get_attribute_value().
*** Reason: Assertion H5Tget_class(attr_type) == H5Tget_class(h5type) failed.
*** Where: This error was encountered inside ../../dolfin/io/HDF5Interface.h (line 596).
"""
Comments (5)
-
-
I'm not sure what has happened with this, because I did get it crashing (as above), but when I rebuilt with the latest master, the
get()
method is not exposed in python, and you can correctly get the attribute value back by using the__getitem__()
method, i.e.print attr["name"]
works. Can you try that?
-
reporter - changed status to resolved
Works again in latest master.
-
I removed the get/set Python method as the set method does not work.
-
- removed milestone
Removing milestone: 1.5 (automated comment)
- Log in to comment