← Back to team overview

python-quantities-developers team mailing list archive

Quantity/numpy member functions vs. static counterparts

 

I have noticed that while many members functions work as we would like them
to work after I overload them, the static member functions in the numpy
namespace are unaffected. For example:

for the sum function
In [13]: y
Out[13]:
[[ 1.  3.  4.  5.]
 [ 1.  2.  3.  6.]]*inch

In [14]: y.sum()
Out[14]: 25.0*inch

In [15]: numpy.sum(y)      # this actually throws an error
... error stuff...

for the ravel function
In [19]: y
Out[19]:
[[ 1.  3.  4.  5.]
 [ 1.  2.  3.  6.]]*inch

In [20]: y.ravel()
Out[20]: [ 1.  3.  4.  5.  1.  2.  3.  6.]*inch

In [21]: numpy.ravel(y)
Out[21]: array([ 1.,  3.,  4.,  5.,  1.,  2.,  3.,  6.])

I am not sure what --if anything-- we want to do about this, and I am not
sure there is a whole lot we *can* do.
Thoughts?

Follow ups