|
From: Daniel W. <dan...@ni...> - 2007-02-21 16:09:45
|
Hi William,
When I run this I just get an error saying:
>>> A.update_add_mask( A,ind,ind,mask,mask )
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: a float is required
I don't think "update_add_mask" is particularly useful as a method.
We tend to use
"update_add_at" as it provides more useful functionality.
Cheers
On Feb 15, 2007, at 12:32 PM, William Hunter wrote:
> Daniel/Roman;
>
> Please check out the following behaviour, or else I'm doing
> something wrong:
>
> A = spmatrix.ll_mat( 2,2 )
> B = asarray( [[1,2][3,4]] )
> ind = asarray( [0,1] )
> mask = ones( (2),dtype=int )
> A.update_add_mask( A,ind,ind,mask,mask )
>
> First, am I using it correctly? (I'm sure I am...)
>
> Secondly, one expects an array:
>
> A = B,
>
> but instead get the following:
>
> A = B.T
>
> Of course one can enter the transpose (B.T) as the update array,
> but that's a work around, also,
> if B is symmetric, it doesn't make a difference anyway, it's just
> that it's confusing at first...
>
> This is fairly trivial to fix (*if* it is a minor bug) in the src
> code, I think, haven't looked yet.
>
> So, while I'm on the subject of src code, I notice that the
> docstrings aren't all the same -- can I correct
> the above mentioned assumed 'bug' and change the docstrings while
> I'm at it?
Whatever you think is the most sensible approach.
> I'll also attempt to fix setup.py so that it finds the NumPy
> headers, this however, will not be trivial, unless
> I assume a standard installation (lib/python/site-packages or
> prefix=/usr/local).
Isn't this a problem with numpy? If you think it is a numpy problem I
think we should approach the numpy people
about it. What do you think?
> By the way, still busy with the manual, adding the other methods
> too (e.g. update_add_at)...
Thanks!
>
> Cheers,
> William
>
>
>
--
Daniel Wheeler
|