[Numpy-discussion] f2py changed ?

Charles Doutriaux doutriaux1@llnl....
Tue Mar 25 14:53:23 CDT 2008


Hi as a follwup the latest error seems to be caused by:
 >>> a=numpy.array(1.)
 >>> a.shape
()
 >>> numpy.asfortranarray(a).shape
(1,)

So in cases where my input is basically a float (but sometimes it has 3 
or more dims) to gets confused

C.

Charles Doutriaux wrote:
> Hello,
>
> I have an f2py module that used to work great, now it breaks,
> first of all the setup.py extension used to have:
>
> #                               f2py_options = ["--fcompiler=gfortran",],
>
> I now need to comment this out, and hope it picks up the right compiler...
>
> at the beg of the script I have a line from the autoconvert:
> import numpy.oldnumeric as Numeric
> when running I get:
>     variable = 
> _gengridzmean.as_column_major_storage(Numeric.transpose(variable.astype 
> (Numeric.Float32).filled(0)))
> AttributeError: 'module' object has no attribute 'as_column_major_storage'
>
> I tried to go around that by using straight numpy calls everywhere and 
> using numpy.asfortranarray instead
>
> But now it collapse a bit further:
>     res = ZonalMeans.compute(s)
>   File 
> "/lgm/cdat/latest/lib/python2.5/site-packages/ZonalMeans/zmean.py", line 
> 397, in compute
>     bandlat) #,imt,jmt,kmt,nt,kmt_grid,iomax,vl)
> _gengridzmean.error: failed in converting 5th argument `mask' of 
> _gengridzmean.zonebasin to C/Fortran array
>
> I checked all my arrays are treated with asfortranarray and even 
> ascontiguousarray to be sure!
>
> I believe this used to work after converting to numpy
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
>   


More information about the Numpy-discussion mailing list