[Numpy-discussion] Array views

Pearu Peterson pearu.peterson at gmail.com
Tue Mar 29 01:13:43 EDT 2011

On Mon, Mar 28, 2011 at 10:44 PM, Sturla Molden <sturla at molden.no> wrote:

> Den 28.03.2011 19:12, skrev Pearu Peterson:
> >
> > FYI, f2py in numpy 1.6.x supports also assumed shape arrays.
> How did you do that? Chasm-interop, C bindings from F03, or marshalling
> through explicit-shape?

The latter.
 Basically, if you have

subroutine foo(a)
real a(:)

then f2py automatically creates a wrapper subroutine

subroutine wrapfoo(a, n)
real a(n)
integer n
!f2py intent(in) :: a
!f2py intent(hide) :: n = shape(a,0)
subroutine foo(a)
real a(:)
end interface
call foo(a)

that can be wrapped with f2py in ordinary way.

> Can f2py pass strided memory from NumPy to Fortran?
No. I haven't thought about it.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110329/d7ecdb57/attachment.html>

More information about the NumPy-Discussion mailing list