Archive for April, 2009

References for Cython/Python buffers

April 21, 2009

PEP 3118, the buffer protocol.

http://www.python.org/dev/peps/pep-3118/

CEP 514, native buffer support in cython

http://wiki.cython.org/enhancements/buffer

Cython/Includes/numpy.pxd

http://hg.cython.org/cython-devel/file/58ff50bda693/Cython/Includes/numpy.pxd

Advertisements

Ecce Blogo

April 21, 2009

It was suggested that I create a blog for my Google Summer of Code project, “Improved Fortran support in Cython.”

Ecce blogo! (or whatever the Latin is for ‘blog.’)

Just to test some things out…

Here’s some python code:

def foo():
    print "hello python"

Here’s some C code:

int main(int argc, char **argv)
{
    printf("hello C\n");
    return 0;
}

Unfortunately wordpress doesn’t have specific fortran support just yet.  But I can do unformatted:

subroutine frobnicate(in_arr, out_arr)
  implicit none
  integer, dimension(:,:), intent(in) :: in_arr
  complex, intent(inout), dimension(:,:) :: out_arr
end subroutine frobnicate