← Back to team overview

python-quantities-developers team mailing list archive

Re: Welcome

 

Related to this: the current stumbling block for "quantitizer" is that
Quantities do not work with comparisons to Inf or -Inf. I will try to add
support for this as I think it is pretty unambiguous. I will also try to
support comparisons to 0 when the offset is 0 or None as this is also
unambiguous. What do you think?

On Fri, Jan 2, 2009 at 4:35 PM, John Salvatier <jsalvatier@xxxxxxxxx> wrote:

> 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
>>
>>
>

References