h5md-user
[Top][All Lists]
Advanced

[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: Wed, 16 Oct 2013 15:11:23 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Konrad,

Thanks for your replies.

On Wed, Oct 16, 2013 at 08:35:54AM +0200, Konrad Hinsen wrote:
> Pierre de Buyl writes:
> 
>  > 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.
> 
> Indeed. On the other hand, if we allow units to be as general as
> allowed by udunits, this means that every program wanting to read H5MD
> must either use udunits or re-implement a large subset of it.

Indeed, your restriction is fine.

>  > 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?
> 
> Yes. My goal was to have something much simpler than udunits, given
> that Mosaic is meant for a much narrower application domain.
> 
>  > Also, I feel like I had to guess a few entries: c (speed of light?), Nav
>  > (Avogadro's number?).
> 
> All units have been documented in the Mosaic specification for a
> while, but I haven't yet put the HTML version on any public server. It
> will be on Github Pages, probably before the end of the week.
> 
> BTW, you guessed right :-)
> 
>  > Is there some kind of "ultimate ASCII SI units definition" available? The 
> xml
>  > files from udunits2 seem close to that :-)
> 
> It's the best collection I know of.

So, to get back to Peter's message:

I propose that we follow udunits grammar by restricting it similarly to Mosaic.
For reference, Mosaic's definition is
"""
The value of the units field is a text string in ASCII encoding. It contains a
sequence of unit factors separated by a space. A unit factor is a unit symbol
optionally followed by a non-zero integer which indicates the power to which
this factor is taken.
"""

I would remove the constants defined ("c" and "Nav"), however. We may want to
add "a unit string must be parseable by udunits"?

Cheers,

Pierre





reply via email to

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