h5md-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[h5md-user] Mandate Variable-length string datatype


From: Peter Colberg
Subject: [h5md-user] Mandate Variable-length string datatype
Date: Thu, 19 Sep 2013 00:28:06 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

This minor proposal sort of builds on Olaf’s major proposal [1] to
explicitely specify HDF5 datatypes, or classes of datatypes.

[1] http://thread.gmane.org/gmane.science.simulation.h5md.user/262

I would like to mandate the variable-length string datatype for all
string values appearing in the specification. The restriction to
variable-length strings simplifies the implementation of H5MD readers
in low-level programs greatly, as fixed-length and variable-length
string datatypes are not convertible.

On the implementation side, h5py needs to be instructed explicitly
to use vlen strings. The h5py author at one point was enthusiastic
and let h5py write vlen strings by default, but user(s) complained
and this sensible default was reverted.

~~~ {.python}
dtype = h5py.special_dtype(vlen=str)
file.attrs.create(name, data, dtype=dtype)
~~~

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]