python-quantities-developers team mailing list archive
-
python-quantities-developers team
-
Mailing list archive
-
Message #00001
Re: Welcome
I added the ability to add quantities with different (but reconcilable)
units.
I also started playing around with a way to create wrapper functions for
functions that you want to have work correctly with Quantities. It currently
works like this:
from quantities import *
from scipy.integrate import quad
def integrate_units(function, x1, x2):
return (function(x1) * x2,function(x1) * x2)
#generate a wrapper function
integrator = quantitizer( quad, integrate_units)
#try it out
func = lambda x: x
#integrate f(x) = x between 1 and 5 m
print integrator(func, 1 * m, 5 * m)
See the __doc__ for quantitizer for a little bit of detail.
I'll push the changes out a bit later.
John
On Fri, Jan 2, 2009 at 4:29 PM, Darren Dale <dsdale24@xxxxxxxxx> wrote:
> Welcome to the python-quantities-developers mailing list!
>
> _______________________________________________
> Mailing list: https://launchpad.net/~python-quantities-developers<https://launchpad.net/%7Epython-quantities-developers>
> Post to : python-quantities-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~python-quantities-developers<https://launchpad.net/%7Epython-quantities-developers>
> More help : https://help.launchpad.net/ListHelp
>
>
Follow ups
References
-
Welcome
From: Darren Dale, 2009-01-03