Re: [Numpy-discussion] Change in memmap behaviour

2012-07-03 Thread Thouis (Ray) Jones
On Mon, Jul 2, 2012 at 11:52 PM, Sveinung Gundersen svein...@gmail.com wrote: On 2. juli 2012, at 22.40, Nathaniel Smith wrote: On Mon, Jul 2, 2012 at 6:54 PM, Sveinung Gundersen svein...@gmail.com wrote: [snip] Your actual memory usage may not have increased as much as you think,

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread George Nurser
Can you interface your fortran program twice? First time return the number of particles, dimensions etc to python python then creates work array of right size Second interface pass work array as in/out array, dimension in fortran argument list, to fortran fortran copies allocatable arrays to

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Andreas Hilboll
Hi numpy. Does anyone know if f2py supports allocatable arrays, allocated inside fortran subroutines? The old f2py docs seem to indicate that the allocatable array must be created with numpy, and dropped in the module. Here's more background to explain... I have a fortran subroutine that

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Jim Vickroy
On 7/2/2012 7:17 PM, Casey W. Stark wrote: Hi numpy. Does anyone know if f2py supports allocatable arrays, allocated inside fortran subroutines? The old f2py docs seem to indicate that the allocatable array must be created with numpy, and dropped in the module. Here's more background to

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 03.07.2012 11:54, skrev George Nurser: module zp implicit none contains subroutine ics(..., num_particles, particle_mass, positions, velocities) use data_types, only : dp implicit none ... inputs ... integer, intent(out) :: num_particles real

Re: [Numpy-discussion] Change in memmap behaviour

2012-07-03 Thread Nathaniel Smith
On Tue, Jul 3, 2012 at 10:35 AM, Thouis (Ray) Jones tho...@gmail.com wrote: On Mon, Jul 2, 2012 at 11:52 PM, Sveinung Gundersen svein...@gmail.com wrote: On 2. juli 2012, at 22.40, Nathaniel Smith wrote: On Mon, Jul 2, 2012 at 6:54 PM, Sveinung Gundersen svein...@gmail.com wrote: [snip]

Re: [Numpy-discussion] import numpy performance

2012-07-03 Thread Chris Barker
On Mon, Jul 2, 2012 at 12:17 PM, Andrew Dalke da...@dalkescientific.com wrote: In this email I propose a few changes which I think are minor and which don't really affect the external NumPy API but which I think could improve the import numpy performance by at least 40%. +1 -- I think I

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Pearu Peterson
On Tue, Jul 3, 2012 at 5:20 PM, Sturla Molden stu...@molden.no wrote: As for f2py: Allocatable arrays are local variables for internal use, and they are not a part of the subroutine's calling interface. f2py only needs to know about the interface, not the local variables. One can have

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Casey W. Stark
Hi all. Thanks for the speedy responses! I'll try to respond to all... The first idea is to split up the routine into two -- one to compute the final size of the arrays, and the second to fill them in. I might end up doing this, because it is simplest, but it means creating the initial

Re: [Numpy-discussion] Would a patch with a function for incrementing an array with advanced indexing be accepted?

2012-07-03 Thread Frédéric Bastien
Hi, Here is code example that work only with different index: import numpy x=numpy.zeros((5,5)) x[[0,2,4]]+=numpy.random.rand(3,5) print x This won't work if in the list [0,2,4], there is index duplication, but with your new code, it will. I think it is the most used case of advanced indexing.

Re: [Numpy-discussion] Buildbot status

2012-07-03 Thread Stéfan van der Walt
On Mon, Jul 2, 2012 at 6:31 PM, Travis Oliphant tra...@continuum.io wrote: Ondrej should have time to work on this full time in the coming days. That's great; having Ondrej on this full time will help a great deal. NumFocus can provide some funding needed for maintaining servers, etc, but

Re: [Numpy-discussion] import numpy performance

2012-07-03 Thread Paul Ivanov
On Mon, Jul 2, 2012 at 2:59 PM, Nathaniel Smith n...@pobox.com wrote: On Mon, Jul 2, 2012 at 10:06 PM, Robert Kern robert.k...@gmail.com wrote: On Mon, Jul 2, 2012 at 9:43 PM, Benjamin Root ben.r...@ou.edu wrote: On Mon, Jul 2, 2012 at 4:34 PM, Nathaniel Smith n...@pobox.com wrote: I think

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 03.07.2012 19:24, skrev Pearu Peterson: One can have allocatable arrays in module data block, for instance, where they a global In Fortran 2003 one can also have allocatable arrays as members in derived types. But neither was the case here. The allocatable was a dummy variable in a

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 03.07.2012 20:38, skrev Casey W. Stark: Sturla, this is valid Fortran, but I agree it might just be a bad idea. The Fortran 90/95 Explained book mentions this in the allocatable dummy arguments section and has an example using an array with allocatable, intent(out) in a subrountine.

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Sturla Molden
Den 04.07.2012 01:59, skrev Sturla Molden: But neither was the case here. The allocatable was a dummy variable in a subroutine's interface, declared with intent(out). That is an error the compiler should trap, because it is doomed to segfault. Ok, so the answer here seems to be: In Fortran