h5md-user
[Top][All Lists]
Advanced

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

Re: [h5md-user] Unit attribute versus non-dimensionless quantities


From: Pierre de Buyl
Subject: Re: [h5md-user] Unit attribute versus non-dimensionless quantities
Date: Thu, 01 Aug 2013 11:15:43 -0400
User-agent: Internet Messaging Program (IMP) H4 (5.0.21)

Hi all,

Peter Colberg <address@hidden> a écrit :
On Thu, Aug 01, 2013 at 01:37:26PM +0200, Pierre de Buyl wrote:
Hi,

On Thu, Aug 01, 2013 at 10:12:38AM +0200, Felix Höfling wrote:
> Am 01.08.2013, 09:56 Uhr, schrieb Felix Höfling <address@hidden>:
> >Am 31.07.2013, 22:40 Uhr, schrieb Peter Colberg
> ><address@hidden>:
> >
> >>I have discovered the perfect implementation of units in H5MD :-).
> >>
>
> h5py has also a low-level API, of course. But I think it is not
> interchangeable with the high-level one and one would have to stick
> to it everywhere. I was not even able to open a file with
> h5py.h5f.open() ...
>
> My conclusion so far is that custom datatypes are something for
> experienced users, but are not suited to become part of the H5MD
> specification.
>
> Felix
>

Peter, your proposition is indeed technically excellent. I have
also toyed with
h5py and if analysis programs have a hard time finding out units in
a file it
might be more troublesome than the current version.

Reading works fine, even for attributes (which is the primary concern):

  import h5py
  f = h5py.File("h5md_units.h5", "r")
  attr = h5py.h5a.open(f.id, "data")
  datatype = h5py.Datatype(attr.get_type())
  print(datatype.attrs["unit"])

I am still figuring out how to teach h5py to write data using HDF5
data types.

I would not be discouraged by h5py's separation into low-level and high-level
APIs. The high-level API exports a *tiny* subset of HDF5's functionality, so
it is not surprising to find that datatypes have so far not been considered
in its design.

Would you agree to postpone units until after version 1.0?

I would remove the units attribute from the specification, which, in
its current form, cannot be implemented. The most important thing to
remember is to avoid the worst case of file format design, breaking
backwards compatibility in a future release.

Given your h5py update, this seems the best solution. No units for 1.0
[he he, I don't use them anyway :-)].

P




reply via email to

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