physical quantities package

Hi Everyone,

I've been wanting a physical quantities package based on numpy for quite a
while. Over the weekend I started one, pulling code from Enthoughts units
package and Charles Doutriaux's python wrappers of udunits (which appears to
work on windows).

I've got a page up at http://dale.chess.cornell.edu/chess-wiki/Quantities
which shows how this thing works and how to get it. Its pretty capable,
reducing units automatically by default, but it provides a mechanism for
preserving compound units too, like J, parsec/cm^3, m^2/m^3, and reducing
them on demand. I also started a unit test suite.

Its pre-alpha, so dont go relying on it for production use, but I thought I
would share it in case anyone is interested.

Darren

Hey Darren,

You may want to take a look at the examples/units/basic_units.py
module which is a poor-man's unit implementation. As a units package,
it's mostly worthless, and is used primarily for testing. But it will
show you how to connect to the mpl unit support to make your unit
arrays work with mpl (which can be done outside of mpl as in the
basic_units module or inside as in the dates support in the dates
module) usin the units registry. Of course, the support for custom
types is incomplete and limited to a few functions (notably plot), and
I have been promising to clarify the units API and requirements, but
in the meantime you might want to experiment with it to see how the
existing framework works with your package.

In terms of clarifying the units requirements, I have been thinking
about it a fair amount and I think this time has been fruitful, but I
haven't committed anything to paper yet.

JDH

ยทยทยท

On Tue, Aug 5, 2008 at 6:30 PM, Darren Dale <dsdale24@...149...> wrote:

I've been wanting a physical quantities package based on numpy for quite a
while. Over the weekend I started one, pulling code from Enthoughts units
package and Charles Doutriaux's python wrappers of udunits (which appears to
work on windows).