Re: [Numpy-discussion] Including .f2py_f2cmap in numpy.distutils?

2015-09-28 Thread Pearu Peterson
Hi, Currently, .f2py_f2cmap must be located in a directory where setup.py or f2py.py is called (to be exact, where numpy.f2py.capi_maps is imported). This location is hardcoded and there is no way to specify the file location within setup.py scripts. However, you don't need to use .f2py_f2cmap fi

Re: [Numpy-discussion] f2py and callbacks with variables

2015-08-13 Thread Pearu Peterson
l also update the github repository with before and > after versions of the .pyf file. > > Go ahead with stackoverflow. Best regards, Pearu Cheers, > Casey > > On 08/12/2015 09:34 PM, Pearu Peterson wrote: > > Hi Casey, > > > > What you observe, is not a f2py b

Re: [Numpy-discussion] f2py and callbacks with variables

2015-08-12 Thread Pearu Peterson
Hi Casey, What you observe, is not a f2py bug. When f2py sees a code like subroutine foo call bar end subroutine foo then it will not make an attempt to analyze bar because of implicit assumption that all statements that has no references to foo arguments are irrelevant for wrapper function ge

Re: [Numpy-discussion] f2py problem with multiple fortran source files

2015-06-13 Thread Pearu Peterson
Hi, On Fri, Jun 12, 2015 at 7:23 PM, 石头 wrote: > Hi,everybody, > I'm new to f2py, and I got some trouble when wrapped some fortran files > to Python. > I have download a Fortran library ( > https://github.com/brianlockwood/ForK), I want to compile these files > into a library and call the lib

Re: [Numpy-discussion] f2py and debug mode

2014-10-03 Thread Pearu Peterson
Hi, When you run f2py without -c option, the wrapper source files are generated without compiling them. With these source files and fortranobject.c, you can build the extension module with your specific compiler options using the compiler framework of your choice. I am not familiar with Visual Stu

[Numpy-discussion] f2py and Fortran STOP statement issue

2013-11-20 Thread Pearu Peterson
Hi, The issue with wrapping Fortran codes that contain STOP statements has been raised several times in past with no good working solution proposed. Recently the issue was raised again in f2py issues. Since the user was filling to test out few ideas with positive results, I decided to describe th

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Pearu Peterson
On Tue, Jul 3, 2012 at 5:20 PM, Sturla Molden 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 allocatable array

Re: [Numpy-discussion] Question on F/C-ordering in numpy svd

2012-01-13 Thread Pearu Peterson
On 01/12/2012 04:21 PM, Ivan Oseledets wrote: > Dear all! > > I quite new to numpy and python. > I am a matlab user, my work is mainly > on multidimensional arrays, and I have a question on the svd function > from numpy.linalg > > It seems that > > u,s,v=svd(a,full_matrices=False) > > returns u a

Re: [Numpy-discussion] How to start at line # x when using numpy.memmap

2011-08-19 Thread Pearu Peterson
On 08/19/2011 05:01 PM, Brent Pedersen wrote: > On Fri, Aug 19, 2011 at 7:29 AM, Jeremy Conlin wrote: >> On Fri, Aug 19, 2011 at 7:19 AM, Pauli Virtanen wrote: >>> Fri, 19 Aug 2011 07:00:31 -0600, Jeremy Conlin wrote: I would like to use numpy's memmap on some data files I have. The first

Re: [Numpy-discussion] Build of current Git HEAD for NumPy fails

2011-08-19 Thread Pearu Peterson
On 08/19/2011 02:26 PM, Dirk Ullrich wrote: > Hi, > > when trying to build current Git HAED of NumPy with - both for > $PYTHON=python2 or $PYTHON=python3: > > $PYTHON setup.py config_fc --fcompiler=gnu95 install --prefix=$WHATEVER > > I get the following error - here for PYTHON=python3.2 The com

Re: [Numpy-discussion] [f2py] How to specify compile options in setup.py

2011-08-16 Thread Pearu Peterson
, On Tue, Aug 16, 2011 at 7:50 PM, Jose Gomez-Dans wrote: > Hi, > > Up to now, I have managed to build Fortran extensions with f2py by ussing > the following command: > $ python setup.py config_fc --fcompiler=gnu95 > --f77flags='-fmy_flags' --f90flags='-fmy_flags' build > > I think that these op

Re: [Numpy-discussion] f2py - undefined symbol: _intel_fast_memset [SEC=UNCLASSIFIED]

2011-08-16 Thread Pearu Peterson
On 08/16/2011 02:32 PM, Jin Lee wrote: > Hello, > > This is my very first attempt at using f2py but I have come across a problem. > If anyone can assist me I would appreciate it very much. > > I have a very simple test Fortran source, sub.f90 which is: > > subroutine sub1(x,y) > implicit non

[Numpy-discussion] ULONG not in UINT16, UINT32, UINT64 under 64-bit windows, is this possible?

2011-08-15 Thread Pearu Peterson
Hi, A student of mine using 32-bit numpy 1.5 under 64-bit Windows 7 noticed that giving a numpy array with dtype=uint32 to an extension module the following codelet would fail: switch(PyArray_TYPE(ARR)) { case PyArray_UINT16: /* do smth */ break; case PyArray_UINT32: /* do smth */ break; ca

Re: [Numpy-discussion] AttributeError in numpy.distutils

2011-05-30 Thread Pearu Peterson
On Sun, May 29, 2011 at 9:19 PM, Ralf Gommers wrote: > > > On Sun, May 22, 2011 at 8:14 PM, Branimir Sesar > wrote: > >> On 05/22/2011 04:17 AM, Ralf Gommers wrote: >> > >> > >> > On Thu, May 19, 2011 at 8:28 PM, Branimir Sesar >> > mailto:bse...@astro.caltech.edu>> wrote: >> > >> > Dear Nump

Re: [Numpy-discussion] Numpy steering group?

2011-05-26 Thread Pearu Peterson
On Fri, May 27, 2011 at 7:39 AM, Matthew Brett wrote: > Hi, > > On Thu, May 26, 2011 at 9:32 PM, Pearu Peterson > wrote: > > Hi, > > > > Would it be possible to setup a signing system where anyone who would > like > > to support Clint could sign and a

Re: [Numpy-discussion] Numpy steering group?

2011-05-26 Thread Pearu Peterson
Hi, Would it be possible to setup a signing system where anyone who would like to support Clint could sign and advertise the system on relevant mailing lists? This would provide larger body of supporters for this letter and perhaps will have greater impact to whom the letter will be addressed. Per

Re: [Numpy-discussion] convert integer into bit array

2011-05-16 Thread Pearu Peterson
On Tue, May 17, 2011 at 8:05 AM, Pearu Peterson wrote: > > > On Tue, May 17, 2011 at 12:04 AM, Nikolas Tautenhahn wrote: > >> Hi, >> >> > Here >> > >> > >> http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarr

Re: [Numpy-discussion] convert integer into bit array

2011-05-16 Thread Pearu Peterson
On Tue, May 17, 2011 at 12:04 AM, Nikolas Tautenhahn wrote: > Hi, > > > Here > > > > > http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy > > > > you can find bitarray with numpy support. > > > > Thanks, that looks promising - to get a numpy array, I ne

Re: [Numpy-discussion] convert integer into bit array

2011-05-16 Thread Pearu Peterson
Hi, I have used bitarray for that http://pypi.python.org/pypi/bitarray/ Here http://code.google.com/p/pylibtiff/source/browse/#svn%2Ftrunk%2Flibtiff%2Fbitarray-0.3.5-numpy you can find bitarray with numpy support. HTH, Pearu On Mon, May 16, 2011 at 9:55 PM, Nikolas Tautenhahn wrote: > H

Re: [Numpy-discussion] f2py complications

2011-05-12 Thread Pearu Peterson
On Thu, May 12, 2011 at 4:14 PM, Jose Gomez-Dans wrote: > Hi, > > We have some fortran code that we'd like to wrap using f2py. The code > consists of a library that we compile into an .so file, and a file that > wraps that library, which is then wrapped by f2py to provide a clean > interface to th

Re: [Numpy-discussion] ANN: Numpy 1.6.0 release candidate 2

2011-05-06 Thread Pearu Peterson
On Sat, May 7, 2011 at 12:00 AM, DJ Luscher wrote: > Pearu Peterson gmail.com> writes: > > > > On Fri, May 6, 2011 at 10:18 PM, DJ Luscher lanl.gov> wrote: > > > > I have encountered another minor hangup. For assumed-shape array-valued > > functions defi

Re: [Numpy-discussion] ANN: Numpy 1.6.0 release candidate 2

2011-05-06 Thread Pearu Peterson
On Fri, May 6, 2011 at 10:18 PM, DJ Luscher wrote: > > I have encountered another minor hangup. For assumed-shape array-valued > functions defined within a fortran module there seems to be some trouble in > the > autogenerated subroutine wrapper interface. I think it has to do with the > order

Re: [Numpy-discussion] ANN: Numpy 1.6.0 release candidate 2

2011-05-06 Thread Pearu Peterson
On Fri, May 6, 2011 at 5:55 PM, DJ Luscher wrote: > Pearu Peterson gmail.com> writes: > > > > > > Thanks for the bug report!These issues are now fixed in: > https://github.com/numpy/numpy/commit/f393b604 Ralf, feel free to apply > this > changeset to 1.6.x br

Re: [Numpy-discussion] ANN: Numpy 1.6.0 release candidate 2

2011-05-05 Thread Pearu Peterson
On Thu, May 5, 2011 at 11:51 PM, DJ Luscher wrote: > > Ralf Gommers googlemail.com> writes: > > > > > Hi, > > > > I am pleased to announce the availability of the second release > > candidate of NumPy 1.6.0. > > > > Compared to the first release candidate, one segfault on (32-bit > > Windows + M

Re: [Numpy-discussion] f2py pass by reference

2011-04-12 Thread Pearu Peterson
;>> hello.foo(a) > Hello from Fortran! > a= 1 > 2 > >>> print a > 1 > >>> > ===== > > i.e. The value of 2 gets printed! This is numpy 1.3.0 > > -Mathew > > > On Tue, Apr 12, 2011 at 11:45 AM, Pearu Peterson >

Re: [Numpy-discussion] f2py pass by reference

2011-04-12 Thread Pearu Peterson
On Tue, Apr 12, 2011 at 9:06 PM, Mathew Yeates wrote: > I have > subroutine foo (a) > integer a > print*, "Hello from Fortran!" > print*, "a=",a > a=2 > end > > and from python I want to do > >>> a=1 > >>> foo(a) > > and I want a's value to now be 2. > How do I do this? >

Re: [Numpy-discussion] division operator

2011-04-04 Thread Pearu Peterson
On 04/04/2011 01:49 PM, Alex Ter-Sarkissov wrote: > I have 2 variables, say var1=10,var2=100. To divide I do either > divide(float(var1),float(var2)) or simply float(var1)/float(var2). I'm > just wondering if there's a smarter way of doing this? >>> from __future__ import division >>> var1 = 1

Re: [Numpy-discussion] [SciPy-Dev] ANN: Numpy 1.6.0 beta 1

2011-03-31 Thread Pearu Peterson
On Thu, Mar 31, 2011 at 1:00 PM, Scott Sinclair wrote: > On 31 March 2011 11:37, Pearu Peterson wrote: > > > > > > On Thu, Mar 31, 2011 at 12:19 PM, David Cournapeau > > wrote: > >> > >> On Wed, Mar 30, 2011 at 7:22 AM, Russell E. Owen wrote: &g

Re: [Numpy-discussion] [SciPy-Dev] ANN: Numpy 1.6.0 beta 1

2011-03-31 Thread Pearu Peterson
On Thu, Mar 31, 2011 at 12:19 PM, David Cournapeau wrote: > On Wed, Mar 30, 2011 at 7:22 AM, Russell E. Owen wrote: > > In article > > , > > Ralf Gommers wrote: > > > >> Hi, > >> > >> I am pleased to announce the availability of the first beta of NumPy > >> 1.6.0. Due to the extensive changes i

Re: [Numpy-discussion] Array views

2011-03-29 Thread Pearu Peterson
On Tue, Mar 29, 2011 at 11:03 AM, Dag Sverre Seljebotn < d.s.seljeb...@astro.uio.no> wrote: > > I think it should be a(1:n*stride:stride) or something. > > Yes, it was my typo and I assumed that n is the length of the original array. Pearu ___ NumPy-Dis

Re: [Numpy-discussion] Array views

2011-03-29 Thread Pearu Peterson
On Tue, Mar 29, 2011 at 8:13 AM, Pearu Peterson wrote: > > > On Mon, Mar 28, 2011 at 10:44 PM, Sturla Molden wrote: > >> Den 28.03.2011 19:12, skrev Pearu Peterson: >> > >> > FYI, f2py in numpy 1.6.x supports also assumed shape arrays. >> >> How

Re: [Numpy-discussion] Array views

2011-03-28 Thread Pearu Peterson
On Mon, Mar 28, 2011 at 10:44 PM, Sturla Molden 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 expli

Re: [Numpy-discussion] Array views

2011-03-28 Thread Pearu Peterson
On Mon, Mar 28, 2011 at 6:01 PM, Sturla Molden wrote > > > I'll try to clarify this: > > ** Most Fortran 77 compilers (and beyond) assume explicit-shape and > assumed-size arrays are contiguous blocks of memory. That is, arrays > declared like a(m,n) or a(m,*). They are usually passed as a pointer

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 1

2011-03-24 Thread Pearu Peterson
On Fri, Mar 25, 2011 at 1:44 AM, Derek Homeier < de...@astro.physik.uni-goettingen.de> wrote: > On 24.03.2011, at 9:11AM, Pearu Peterson wrote: > > > > Intel-64bit: > > ERROR: test_assumed_shape.TestAssu

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 1

2011-03-24 Thread Pearu Peterson
On Thu, Mar 24, 2011 at 10:11 AM, Pearu Peterson wrote: > > Regarding this test failure, could you hack the > numpy/f2py/tests/test_kind.py script by adding the following code > > for i in range(20): > print '%s -> %s, %s' % (i, selected_real_kind(i), selectedr

Re: [Numpy-discussion] ANN: Numpy 1.6.0 beta 1

2011-03-24 Thread Pearu Peterson
On Thu, Mar 24, 2011 at 2:04 AM, Derek Homeier < de...@astro.physik.uni-goettingen.de> wrote: > On 24 Mar 2011, at 00:34, Derek Homeier wrote: > > > tests with the fink-installed pythons on MacOS X mostly succeeded, > > with one failure in python2.4 and a couple of issues seemingly > > related to

Re: [Numpy-discussion] 1.6: branching and release notes

2011-03-13 Thread Pearu Peterson
On Sun, Mar 13, 2011 at 11:22 AM, Ralf Gommers wrote: > Hi all, > > On Tuesday (~2am GMT) I plan to create the 1.6.x branch and tag the > first beta. So please get your last commits for 1.6 in by Monday > evening. > > Also, please review and add to the 1.6.0 release notes. I put in > headers for s

Re: [Numpy-discussion] how to compile Fortran using setup.py

2011-03-12 Thread Pearu Peterson
On Fri, Mar 11, 2011 at 3:58 AM, Ondrej Certik wrote: > Hi, > > I spent about an hour googling and didn't figure this out. Here is my > setup.py: > > setup( >name = "libqsnake", >cmdclass = {'build_ext': build_ext}, >version = "0.1", >packages = [ >'qsnake', >'qsna

Re: [Numpy-discussion] Pushing changes to numpy git repo problem

2010-12-02 Thread Pearu Peterson
Thanks! Pearu On Thu, Dec 2, 2010 at 11:08 PM, Charles R Harris wrote: > > > On Thu, Dec 2, 2010 at 1:52 PM, Pearu Peterson > wrote: >> >> Hi, >> >> I have followed Development workflow instructions in >> >>  http://docs.scipy.org/doc/numpy/dev/g

[Numpy-discussion] Pushing changes to numpy git repo problem

2010-12-02 Thread Pearu Peterson
Hi, I have followed Development workflow instructions in http://docs.scipy.org/doc/numpy/dev/gitwash/ but I am having a problem with the last step: $ git push upstream ticket1679:master fatal: remote error: You can't push to git://github.com/numpy/numpy.git Use g...@github.com:numpy/numpy

Re: [Numpy-discussion] Atlas build issues

2010-10-20 Thread Pearu Peterson
On 10/20/2010 11:48 AM, Gael Varoquaux wrote: > On Wed, Oct 20, 2010 at 04:41:38PM +0900, David wrote: >>> - ldd /volatile/varoquau/dev/numpy/numpy/linalg/lapack_lite.so: does it >>> load the libraries you think are you loading ? > > For the dynamic libraries, it seems so. I am using static l

Re: [Numpy-discussion] Atlas build issues

2010-10-20 Thread Pearu Peterson
On 10/20/2010 10:23 AM, Gael Varoquaux wrote: > I am really sorry to be landing on the mailing list with Atlas build > issues. I usually manage be myself to build Atlas, but this time I have > been fighting for a couple of days with little success. > > The reason I need to build Atlas is that our

Re: [Numpy-discussion] Another merge at github

2010-10-18 Thread Pearu Peterson
On 10/16/2010 09:53 PM, Charles R Harris wrote: > Here > . > This looks harmless but it makes the history really ugly. We need to get > the word out *not* to do things this way. Sorry, that was me and my git ignorance

Re: [Numpy-discussion] Another merge at github

2010-10-18 Thread Pearu Peterson
On 10/16/2010 09:53 PM, Charles R Harris wrote: > Here > . > This looks harmless but it makes the history really ugly. We need to get > the word out *not* to do things this way. Sorry, that was me and my git ignorance

Re: [Numpy-discussion] compile fortran from python

2010-10-10 Thread Pearu Peterson
Hi, You can create a setup.py file containing def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration(None,parent_package,top_path) config.add_library('flib', sources = [test.f95]) config.add_extension('cte

Re: [Numpy-discussion] Please help on compilation fortran module using f2py

2010-10-06 Thread Pearu Peterson
Hi, On 10/06/2010 04:57 AM, Jing wrote: > Hi, everyone: > > I am new to the python numpy and f2py. I really need help on compiling > FORTRAN module using f2py. I have been searched internet without any > success. Here is my setup: I have a Ubuntu 10.04 LTS with python 2.6, > numpy 1.3.0 and f2py

Re: [Numpy-discussion] f2py problem with complex inout in subroutine

2010-07-24 Thread Pearu Peterson
Hi Mark, On Mon, Jul 19, 2010 at 11:49 AM, Mark Bakker wrote: > Thanks for fixing this, Pearu. > Complex arrays with intent(inout) don't seem to work either. > They compile, but a problem occurs when calling the routine. What problem? > Did you fix that as well? I guess so, see below. > Here'

Re: [Numpy-discussion] f2py problem with complex inout in subroutine

2010-07-10 Thread Pearu Peterson
On 07/09/2010 02:03 PM, Mark Bakker wrote: > Hello list. The following subroutine fails to compile with f2py. > I use a complex variable with intent(inout). It works fine with two real > variables, so I have a workaround, but it would be nicer with a complex > variable. > Any thoughts on what I a

Re: [Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Pearu Peterson
On Sun, Jun 13, 2010 at 4:45 PM, Nadav Horesh wrote: > int can be larger than numpy.int64 therefore it should be coerced to float64 > (or float96/float128) Ok, I see. The results type is defined by the types of operands, not by their values. I guess this has been discussed earlier but with small

[Numpy-discussion] Possible bug: uint64 + int gives float64

2010-06-13 Thread Pearu Peterson
Hi, I just noticed some weird behavior in operations with uint64 and int, heres an example: >>> numpy.uint64(3)+1 4.0 >>> type(numpy.uint64(3)+1) Pearu ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/l

Re: [Numpy-discussion] How to resize numpy.memmap?

2010-06-06 Thread Pearu Peterson
(newshape)? For example, for resolving the original problem, one could have fp = numpy.memmap('test.dat', shape=(10,), mode='w+') fp = fp.resized(11) Regards, Pearu On Sun, Jun 6, 2010 at 10:19 PM, Pearu Peterson wrote: > Hi, > > I am creating a rather large file

[Numpy-discussion] How to resize numpy.memmap?

2010-06-06 Thread Pearu Peterson
Hi, I am creating a rather large file (typically 100MBi-1GBi) with numpy.memmap but in some cases the initial estimate to the file size is just few bytes too small. So, I was trying to resize the memmap with a failure as demonstrated with the following example: >>> fp = numpy.memmap('test.dat', s

Re: [Numpy-discussion] f2py: "could not crack entity declaration"

2010-03-25 Thread Pearu Peterson
Try renaming GLMnet.f90 to GLMnet.f. HTH, Pearu David Warde-Farley wrote: > I decided to give wrapping this code a try: > > http://morrislab.med.utoronto.ca/~dwf/GLMnet.f90 > > I'm afraid my Fortran skills are fairly limited, but I do know that > gfortran compiles it fine. f2py run on th

Re: [Numpy-discussion] f2py compiler version errors

2010-03-17 Thread Pearu Peterson
shared', '-tpp7', '-xW', '-arch SSE2'] > object_switch = '-o ' > ranlib = ['ranlib'] > version = None > version_cmd = > ['/opt/in

Re: [Numpy-discussion] Getting Callbacks with arrays to work

2010-01-12 Thread Pearu Peterson
Hi, The problem is that f2py does not support callbacks that return arrays. There is easy workaround to that: provide returnable arrays as arguments to callback functions. Using your example: SUBROUTINE CallbackTest(dv,v0,Vout,N) IMPLICIT NONE !F2PY intent( hide ):: N INTEGER:: N, ic

Re: [Numpy-discussion] f2py callback bug?

2009-11-25 Thread Pearu Peterson
] > in fortran after pycalc j= 60 > [60] > [3] > > Why is the return from foo.calc different from j? > How do I make them the same? > "return j" in pycalc doesn't change things. > > Thanks again! > > At 12:06 AM 11/25/2009, you wr

Re: [Numpy-discussion] f2py callback bug?

2009-11-25 Thread Pearu Peterson
Pearu Peterson wrote: > Hmm, regarding `intent(in, out) j`, this should work. I'll check what > is going on.. The `intent(in, out) j` works when pycalc is defined as subroutine: call pycalc(i, j) instead of pyreturn = pycalc(i

Re: [Numpy-discussion] f2py callback bug?

2009-11-24 Thread Pearu Peterson
Hi, It is not really a bug what you are seeing.. In pycalc when assigning j = 20 * j you create a new object `j` and the argument object `j`, that links back to Fortran data, gets discarded. So, you can change j inplace, for example: j[:] = 20*j The first argument `i` is int object that in

Re: [Numpy-discussion] f2py function callback: error while using repeated arguments in function call

2009-11-09 Thread Pearu Peterson
Yves Frederix wrote: > Hi, > > I am doing a simple function callback from fortran to python for which > the actual function call in fortran has repeated arguments. > > ! callback_error.f90: > subroutine testfun(x) >double precision, intent(in) :: x >double precision :: y > !f2py intent(c

[Numpy-discussion] ANN: a journal paper about F2PY has been published

2009-10-05 Thread Pearu Peterson
Original Message Subject: [f2py] ANN: a journal paper about F2PY has been published Date: Mon, 05 Oct 2009 11:52:20 +0300 From: Pearu Peterson Reply-To: For users of the f2py program To: For users of the f2py program Hi, A journal paper about F2PY has been published in

Re: [Numpy-discussion] Superfluous array transpose (cf. ticket #1054)

2009-03-16 Thread Pearu Peterson
On Mon, March 16, 2009 4:05 pm, Sturla Molden wrote: > On 3/16/2009 9:27 AM, Pearu Peterson wrote: > >> If a operation produces new array then the new array should have the >> storage properties of the lhs operand. > > That would not be enough, as 1+a would behave d

Re: [Numpy-discussion] Superfluous array transpose (cf. ticket #1054)

2009-03-16 Thread Pearu Peterson
On Sun, March 15, 2009 8:57 pm, Sturla Molden wrote: > > Regarding ticket #1054. What is the reason for this strange behaviour? > a = np.zeros((10,10),order='F') a.flags > C_CONTIGUOUS : False > F_CONTIGUOUS : True > OWNDATA : True > WRITEABLE : True > ALIGNED : True > UPDATEI

Re: [Numpy-discussion] What is the logical value of nan?

2009-03-10 Thread Pearu Peterson
On Wed, March 11, 2009 7:50 am, Christopher Barker wrote: > > > Python does not distinguish between True and > > > False -- Python makes the distinction between something and nothing. > > In that context, NaN is nothing, thus False. Mathematically speaking, NaN is a quantity with undefined valu

Re: [Numpy-discussion] error handling with f2py?

2009-01-16 Thread Pearu Peterson
On Thu, January 15, 2009 6:17 pm, Sturla Molden wrote: > Is it possible to make f2py raise an exception if a fortran routine > signals an error? > > If I e.g. have > > subroutine foobar(a, ierr) > > Can I get an exception automatically raised if ierr != 0? Yes, for that you need to provide yo

Re: [Numpy-discussion] f2py - a recap

2008-07-24 Thread Pearu Peterson
Hi, Few months ago I joined a group of system biologist and I have been busy with new projects (mostly C++ based). So I haven't had a chance to work on f2py. However, I am still around to fix f2py bugs and maintain/support numpy.f2py (as long as current numpy maintainers allow it..) -- as a rule

Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Pearu Peterson
On Wed, July 2, 2008 8:25 pm, Robert Kern wrote: > On Wed, Jul 2, 2008 at 09:01, Alan McIntyre <[EMAIL PROTECTED]> > wrote: >> On Wed, Jul 2, 2008 at 9:35 AM, Pearu Peterson <[EMAIL PROTECTED]> >> wrote: >>> Alan McIntyre wrote: >>>> Some test f

Re: [Numpy-discussion] set_local_path in test files

2008-07-02 Thread Pearu Peterson
Alan McIntyre wrote: > Some test files have a set_local_path()/restore_path() pair at the > top, and some don't. Is there any reason to be changing sys.path like > this in the test modules? If not, I'll take them out when I see them. The idea behind set_local_path is that it allows running test

Re: [Numpy-discussion] error importing a f2py compiled module.

2008-06-23 Thread Pearu Peterson
On Mon, June 23, 2008 10:38 am, Fabrice Silva wrote: > Dear all > I've tried to run f2py on a fortran file which used to be usable from > python some months ago. > Following command lines are applied with success (no errors raised) : > f2py -m modulename -h tmpo.pyf --overwrite-signature

Re: [Numpy-discussion] seeking help with f2py_options

2008-06-21 Thread Pearu Peterson
On Sat, June 21, 2008 3:28 pm, Helmut Rathgen wrote: > Dear all, > > I am trying to write a setp.py based on numpy.distutils for a mixed > python/fortran90 package. > > I'd like to specify the fortran compiler, such as the path to the > compiler, compiler flags, etc. in setup.py. > > I seemed to un

Re: [Numpy-discussion] nose changes checked in

2008-06-17 Thread Pearu Peterson
On Tue, June 17, 2008 6:17 am, Robert Kern wrote: > On Mon, Jun 16, 2008 at 21:18, Alan McIntyre <[EMAIL PROTECTED]> > wrote: >> On Mon, Jun 16, 2008 at 9:04 PM, Charles R Harris >> <[EMAIL PROTECTED]> wrote: > >>> In [1]: numpy.test() >>> Not implemented: Defined_Binary_Op >>> Not implemented: Def

Re: [Numpy-discussion] [Numpy-svn] r5198 - trunk/numpy/f2py

2008-05-20 Thread Pearu Peterson
On Tue, May 20, 2008 1:36 pm, Jarrod Millman wrote: > On Mon, May 19, 2008 at 10:29 PM, Pearu Peterson <[EMAIL PROTECTED]> > wrote: >> On Tue, May 20, 2008 1:26 am, Robert Kern wrote: >>> Is this an important bugfix? If not, can you hold off until 1.1.0 is >>&g

Re: [Numpy-discussion] Branching 1.1.x and starting 1.2.x development

2008-05-20 Thread Pearu Peterson
On Tue, May 20, 2008 12:59 pm, Jarrod Millman wrote: > Commits to the trunk (1.2.x) should follow these rules: > > 1. Documentation fixes are allowed and strongly encouraged. > 2. Bug-fixes are strongly encouraged. > 3. Do not break backwards compatibility. > 4. New features are permissible. >

Re: [Numpy-discussion] [Numpy-svn] r5198 - trunk/numpy/f2py

2008-05-20 Thread Pearu Peterson
On Tue, May 20, 2008 12:03 pm, David Cournapeau wrote: > Pearu Peterson wrote: >> f2py changes are never critical to numpy users who do not use f2py. >> > No, but they are to scipy users if f2py cannot build scipy. Well, I know pretty well what f2py features scipy uses and what

Re: [Numpy-discussion] [Numpy-svn] r5198 - trunk/numpy/f2py

2008-05-20 Thread Pearu Peterson
David Cournapeau wrote: > Pearu Peterson wrote: >> So I beg to be flexible with f2py related commits for now. > > Why not creating a branch for the those changes, and applying only > critical bug fixes to the trunk ? How do you define a critical bug? Critical to whom? f2py

Re: [Numpy-discussion] [Numpy-svn] r5198 - trunk/numpy/f2py

2008-05-20 Thread Pearu Peterson
Stéfan van der Walt wrote: > Hi Pearu > > 2008/5/20 Pearu Peterson <[EMAIL PROTECTED]>: >> CC: numpy-discussion because of other reactions on the subject. >> >> On Tue, May 20, 2008 1:26 am, Robert Kern wrote: >>> Is this an important bugfix? If not, ca

Re: [Numpy-discussion] [Numpy-svn] r5198 - trunk/numpy/f2py

2008-05-19 Thread Pearu Peterson
CC: numpy-discussion because of other reactions on the subject. On Tue, May 20, 2008 1:26 am, Robert Kern wrote: > Is this an important bugfix? If not, can you hold off until 1.1.0 is > released? The patch fixes a long existing and unreported bug in f2py - I think the bug was introduced when Pyth

Re: [Numpy-discussion] numpy.distutils: building a f2py in a subdir

2008-05-18 Thread Pearu Peterson
On Sun, May 18, 2008 1:14 pm, David Cournapeau wrote: > Hi, > > I would like to be able to build a f2py extension in a subdir with > distutils, that is: > > config.add_extension('foo/bar', source = ['foo/bar.pyf']) A safe approach would be to create a foo/setup.py that contains config.add_ex

Re: [Numpy-discussion] Tagging 1.1rc1 in about 12 hours

2008-05-17 Thread Pearu Peterson
On Sat, May 17, 2008 7:48 pm, Charles R Harris wrote: > On Fri, May 16, 2008 at 1:20 AM, Jarrod Millman <[EMAIL PROTECTED]> > wrote: >> Once I tag 1.1.0, I will open the trunk for 1.1.1 development. ... >> Any development for 1.2 will have to occur on a new branch. > > So open the new branch alrea

Re: [Numpy-discussion] Tagging 1.1rc1 in about 12 hours

2008-05-16 Thread Pearu Peterson
Jarrod Millman wrote: > Hello, > > I believe that we have now addressed everything that was holding up > the 1.1.0 release, so I will be tagging the 1.1.0rc1 in about 12 > hours. Please be extremely conservative and careful about any commits > you make to the trunk until we officially release 1

Re: [Numpy-discussion] let's use patch review

2008-05-15 Thread Pearu Peterson
On Thu, May 15, 2008 12:06 am, Ondrej Certik wrote: > Hi, > > I read the recent flamebate about unittests, formal procedures for a > commit etc. and it was amusing. :) > I think Stefan is right about the unit tests. I also think that Travis > is right that there is no formal procedure that can assu

Re: [Numpy-discussion] f2py and -D_FORTIFY_SOURCE=2 compilation flag

2008-05-15 Thread Pearu Peterson
Robert Kern wrote: > On Wed, May 14, 2008 at 3:20 PM, David Huard <[EMAIL PROTECTED]> wrote: >> I filed a patch that seems to do the trick in ticket #792. > > I don't think this is the right approach. The problem isn't that > _FORTIFY_SOURCE is set to 2 but that f2py is doing (probably) bad > th

Re: [Numpy-discussion] First steps with f2py and first problems...

2008-05-08 Thread Pearu Peterson
On Thu, May 8, 2008 2:06 pm, LB wrote: > Hi, > > I've tried to follow the example given at : > http://www.scipy.org/Cookbook/Theoretical_Ecology/Hastings_and_Powell > but I've got errors when compiling the fortran file : > > 12:53 loic:~ % f2py -c -m hastings hastings.f90 --fcompiler=gnu95 ...

Re: [Numpy-discussion] 673

2008-04-28 Thread Pearu Peterson
Hi, As far as I am concerned, the issue needs a cosmetic fix of renaming pythonxerbla to python_xerbla and the rest of the issue can be postponed to 1.2. Note that this isn't purely a numpy issue. To fix the issue, system or user provided blas/lapack libraries need to be changed, we can only give

Re: [Numpy-discussion] tests in distutils/exec_command.py

2008-04-26 Thread Pearu Peterson
On Sat, April 26, 2008 7:53 pm, Zbyszek Szmek wrote: > Hi, > while looking at test coverage statistics published Stéfan van der Walt > at http://mentat.za.net/numpy/coverage/, I noticed that the > least-covered file, numpy/distutils/exec_command.py has it's own > test routines, e.g.: > def test_svn

[Numpy-discussion] New web site for the F2PY. tool

2008-04-24 Thread Pearu Peterson
Hi, I have created a new web site for the F2PY tool: http://www.f2py.org that will be used to collect F2PY related information. At the moment, the site contains minimal information but hopefully this will improve in future. One can add content to the f2py.org site after registration (see Regi

Re: [Numpy-discussion] f2py: optional parameters and present() bug?

2008-04-23 Thread Pearu Peterson
Garry Willgoose wrote: > in a F90 routine called from python the present() test (for optional > parameters) always returns true whether the parameter is present in > the function call or not. My F90 test code looks like this > > subroutine test(test1,test2,test3) >integer,intent(in) :: t

Re: [Numpy-discussion] [numscons] 0.6.1 release: it build scipy, and on windows !

2008-04-21 Thread Pearu Peterson
David Cournapeau wrote: > - f2py has been almost entirely rewritten: it can now scan the > module name automatically, and should be much more reliable. What do you mean by ^^^? ;) Pearu ___ Numpy-

Re: [Numpy-discussion] f2py on windows cant find gfortran because split_quoted() removed from ccompiler.py

2008-04-21 Thread Pearu Peterson
Jarrod Millman wrote: > Our version of split_quoted() was added several years ago and should > I think be submitted for inclusion upstream. I know that distutils > isn't exactly being maintained, but--Pearu--is it possible that we > could get this upstream? I looked into the distutils code aga

Re: [Numpy-discussion] F2PY future

2008-04-11 Thread Pearu Peterson
Bill Baxter wrote: > I'm afraid I'm not much help answering your questions. But one thing > I've wondered about f2py is if it could be generalized into an f2*** > tool. How intertwined is the analysis of the fortran with the > synthesis of the python? There are lots of languages that could > be

[Numpy-discussion] F2PY future

2008-04-11 Thread Pearu Peterson
Hi, I am in a process of writing a scientific paper about F2PY that will provide an automatic solution to the Python and Fortran connection problem. While writing it, I also need to decide what will be the future of F2PY. In particulary, I have the following main questions to which I am lookin

Re: [Numpy-discussion] ticket #587

2008-04-09 Thread Pearu Peterson
On Wed, April 9, 2008 3:25 pm, Jarrod Millman wrote: > On Wed, Apr 9, 2008 at 4:59 AM, Pearu Peterson <[EMAIL PROTECTED]> wrote: >> I have fixed it in r4996. > > Thanks, > >> However, when trying to change the ticked status, I get forbidden >> error: >>

Re: [Numpy-discussion] ticket #587

2008-04-09 Thread Pearu Peterson
On Wed, April 9, 2008 2:13 pm, Jarrod Millman wrote: > Hey Pearu, > > Could you take a quick look at this: > http://projects.scipy.org/scipy/numpy/ticket/587 I have fixed it in r4996. However, when trying to change the ticked status, I get forbidden error: TICKET_APPEND privileges are required t

Re: [Numpy-discussion] f2py functions, docstrings, and epydoc

2008-03-27 Thread Pearu Peterson
On Thu, March 27, 2008 7:20 pm, Tom Loredo wrote: > > Pearu- > >> smll_offset = smll_offset >> exec `smll_offset.__doc__` > > Thanks for the quick and helpful response! I'll give it > a try. I don't grasp why it works, though. I suppose I don't > need to, but... I'm guessing the exec adds stuff

Re: [Numpy-discussion] f2py functions, docstrings, and epydoc

2008-03-27 Thread Pearu Peterson
Hi, Tom Loredo wrote: > Hi folks- > > Can anyone offer any tips on how I can get epydoc to produce > API documentation for functions in an f2py-produced module? > Currently they get listed in the generated docs as "Variables": > > Variables > psigc = > sigctp = > smll_offset

Re: [Numpy-discussion] f2py : callbacks without callback function as an argument

2008-03-12 Thread Pearu Peterson
On Wed, March 12, 2008 8:38 am, Daniel Creveling wrote: > Hello- > > Is there a way to code a callback to python from > fortran in a way such that the calling routine does > not need the callback function as an input argument? > I'm using the Intel fortran compiler for linux with > numpy 1.0.4 and

[Numpy-discussion] ANN: sympycore version 0.1 released

2008-02-29 Thread Pearu Peterson
eated to fix SymPy performance and robustness issues. Sympycore does not yet have nearly as many features as SymPy. Our goal is to work on in direction of merging the efforts with the SymPy project in the near future. Enjoy! * Pearu Peterson * Fredrik Johansson Acknowledgments: * The wo

Re: [Numpy-discussion] f2py: sharing F90 module data between modules

2008-02-14 Thread Pearu Peterson
On Thu, February 14, 2008 8:24 am, Garry Willgoose wrote: > Thanks for that. The docs suggest library dl is Unix only. Does that > mean this solution will not work on Windows? Windows is on my > implementation roadmap but I'm not quite there yet to test it. I have no idea whether it will work on W

Re: [Numpy-discussion] f2py: sharing F90 module data between modules

2008-02-12 Thread Pearu Peterson
On Tue, February 12, 2008 7:52 am, Garry Willgoose wrote: > I have a suite of fortran modules that I want to wrap with f2py > independently (so they appear to python as seperate imports) but > where each module has access to another fortran module (which > contains global data that is shared betwee

Re: [Numpy-discussion] f2py compiled module not found by python

2008-02-06 Thread Pearu Peterson
On Wed, February 6, 2008 8:35 pm, Chris wrote: > Hello, > > I'm trying to build a package on Linux (Ubuntu) that contains a fortran > module, built using f2py. However, despite the module building and > installing without error, python cannot seem to see it (see log below). > This works fine on Win

Re: [Numpy-discussion] [F2PY]: Allocatable Arrays

2008-02-04 Thread Pearu Peterson
On Mon, February 4, 2008 4:39 pm, Lisandro Dalcin wrote: > Pearu, now that f2py is part of numpy, I think it would be easier for > you and also for users to post to the numpy list for f2py-related > issues. What do you think? Personaly, I don't have strong opinions on this. On one hand, it would

  1   2   >