I've been playing with __array_wrap__ to make quantities with units play
well with numpy's ufuncs. For example, __array_wrap__ makes it is possible
to do the following:

>>> numpy.sqrt([1.,4.,9.]*m**2)
array([1.,2.,3.])*m

Is there an analog to __array_wrap__ for preprocessing arrays on their way
*into* a ufunc? For example, it would be nice if one could do something
like:

numpy.sin([1,2,3]*arcseconds)

where we have the opportunity to inspect the context, convert the Quantity
to units of radians, and then actually call the ufunc. Is this possible, or
does one have to reimplement such functions?

Thanks,
Darren
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to