[SciPy-dev] physical quantities: udunits?

Darren Dale dsdale24@gmail....
Fri Aug 1 09:53:36 CDT 2008


Hi Charles,

Yes, I think I would like to take a shot at this. I have been meaning to get 
back to the matplotlib documentation effort, but I really need this for work. 
I'll look into it this weekend.

Thanks,
Darren

On Friday 01 August 2008 10:28:29 am Charles Doutriaux wrote:
> Hi Darren,
>
> Here are some examples:
>  >>> a = unidata.udunits(1,'m')
>  >>> a.to('cm')
>
> udunits(100.0,"cm")
>
> You can also use:
> a.known_units()
> or
> a.available_units()
>
> Come to think of it I should change it so it only shows units compatible
> with "a"
>
> Anyway, sorry I pointed to the "trunk" version, I forgot it is still
> Numeric based. Or devel version is numpy based.
>
> you can access it at:
> svn export
> http://www-pcmdi.llnl.gov/svn/repository/cdat/branches/devel/Packages/unida
>ta user: guest
> psswd: cdatdevel
>
> It is indeed based on udunits (not udunits2). I should upgrade.
>
> You're right we could probably subclass numpy. Do you want to do it?
>
> Honestly I don't think i'll have time in the next month or so.
>
> C.
>
> Darren Dale wrote:
> > Hi Charles,
> >
> > On Thursday 31 July 2008 06:56:33 pm you wrote:
> >> Ok looks like our security update was a bit too strong :) can you try
> >> again ?
> >
> > Thanks, I am able to grab the sources now.
> >
> > I did a search on the web a few days ago to see if udunits can be used on
> > Windows. The answer appeared to be no, but I tried installing your
> > unidata python package on windows anyway.
> >
> > There is no windows binary for Numeric and python-2.5, so I tried a first
> > order workaround by changing the Numeric include in udunits_wrap.c to:
> >
> > #include "numpy/arrayobject.h"
> >
> > This required importing numpy in your setup script and adding
> > numpy.get_include() to the list of include_dirs in your extension
> > constructor. I also had to modify the path where udunits is installed, in
> > both setup.py and udunits.py. (moving udunits.dat into Lib would allow
> > the library to be installed using distutils package_data, I think.)
> >
> > I am happy to say that I was able to build the package with mingw,
> > install it, and run the test script. I didn't see any problems (but I
> > didn't really know what to look for).
> >
> > Would you mind posting a link to your udunits2 package?
> >
> > Based on your nice work here, and the appearance of windows
> > compatibility, it seems like it shouldn't be too difficult to build a
> > physical_quantities object subclassed from numpy.ndarray. Have you
> > considered this possibility?
> >
> > Regards,
> > Darren




More information about the Scipy-dev mailing list