From: David M. C. <co...@ph...> - 2006-08-10 18:22:40
|
On Thu, 10 Aug 2006 07:33:44 -0600 (MDT) "Daran L. Rife" <dr...@uc...> wrote: > Hello, > > I am a veteran user of Numeric and am trying > out the latest version of numpy (numpy 1.01b) > on Mac OS X 10.4 Tiger (8.7.0). > > When trying to invert a matrix with > numpy.linalg.inv I get the following error: > > ----> > > Traceback (most recent call last): > File "./bias_correction.py", line 381, in ? > if __name__ == "__main__": main() > File "./bias_correction.py", line 373, in main > (index_to_stnid, bias_and_innov) = calc_bias_and_innov(cf, stn_info, > obs, infile_obs, grids, infile_grids) > File "./bias_correction.py", line 297, in calc_bias_and_innov > K = make_kalman_gain(R, P_local, H) > File "./bias_correction.py", line 157, in make_kalman_gain > K = MA.dot( MA.dot(P, MA.transpose(H)), inv(MA.dot(H, MA.dot(P, > MA.transpose(H))) + R ) ) > File "/opt/python/lib/python2.4/site-packages/numpy/linalg/linalg.py", > line 149, in inv > return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) > TypeError: __array_wrap__() takes exactly 3 arguments (2 given) > > <---- > > Is this a known problem, and if so, what is the fix? It looks like the problem is that numpy.core.ma.MaskedArray.__array_map__ expects a "context" argument, but none gets passed. I'm not familiar with that, so I don't know what the fix is ... -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |co...@ph... |