creating empty property fails
the following code works:
section.create_property("test", None)
this version fails with an assert error which cannot be caught:
section.create_property("test", [])
I guess we should allow this.
On a similar note, the same assertion error is triggered when trying to store an empty nix.Value.
>>> nix.Value()
Value{[Nothing] }
>>> section.create_property("test", nix.Value())
... nix/backend/hdf5/PropertyHDF5.cpp:305: static nix::hdf5::h5x::DataType nix::hdf5::PropertyHDF5::fileTypeForValue(nix::DataType): Assertion `false' failed.
I'd expect since an empty (Nothing) value is supported by nix.Value, that at least that would be supported as a property, even if None were not supported.
@achilleas-k problem is, what would be the type of the underlying property, i.e. the type of the DataSet in HDF5 holding the property? Catching the error earlier is of course needed.
Right, no null-type in the backend. Understandable.
By catching the error earlier, do you mean removing Value{[Nothing] } so that the error is caught on creation of the property value?
Empty properties can be created if a dtype is specified.
E.g.,
sec.create_property("empty", values_or_dtype=nix.DataType.String)
Should we close this?