[Top][All Lists]

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

Re: [h5md-user] units module

From: Pierre de Buyl
Subject: Re: [h5md-user] units module
Date: Mon, 14 Oct 2013 13:58:54 +0200
User-agent: Mutt/1.5.21 (2010-09-15)


On Fri, Oct 11, 2013 at 11:06:42AM -0400, Peter Colberg wrote:
> Before adding a units module to the repository that defines an
> optional unit system for the "unit" attributes, I would like to
> solicit feedback from the H5MD community.
> The idea is to have a module named "units" that carries a module
> attribute "system" that defines the unit system. Rather than having
> a separate module for each unit system, this way a program can query
> the unit system by reading the attribute "/h5md/modules/address@hidden".

Do you mean

\-- h5md
    \-- modules
        \-- units
            +-- system


> The module would initially support the unit system "si". Here the
> question is whether and how to define the format of the unit strings.
> Konrad suggested the udunits2 package earlier. It seems a good basis:
> http://www.unidata.ucar.edu/software/udunits/udunits-2/udunits2lib.html#Syntax

I just toyed a bit with udunits2 and it seems very nice. The fact that we can
rely on this software if need is good.

> The udunits2 grammar is very flexible. It would probably be sensible
> to define a smaller grammar, so programs wishing to interpret units do
> not have to use the udunits2 library due to the complexity of parsing.

"smaller" how?

In Mosaic [1], the restriction is, if I understand well:
1. whitespace separation only (so no "." that is allowed with udunits).
2. Not all units are allowed.
3. No repeat units (no "m m", for instance, but only "m2").

Konrad, can you confirm?

Also, I feel like I had to guess a few entries: c (speed of light?), Nav
(Avogadro's number?).

For H5MD, what would we use? I feel that excluding "." as a separator is good.

Is there some kind of "ultimate ASCII SI units definition" available? The xml
files from udunits2 seem close to that :-)




reply via email to

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