Re: [Numpy-discussion] NotImplementedType should be an exception

2008-06-21 Thread Charles R Harris
On Fri, Jun 20, 2008 at 11:21 PM, Charles R Harris [EMAIL PROTECTED] wrote: Shouldn't this raise an NotImplementedError exception? In [7]: type(remainder(complex192(1), complex192(1))) Out[7]: type 'NotImplementedType' I suspect these types should both have Py_TPFLAGS_CHECKTYPES bit set in

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Dag Sverre Seljebotn
Dag wrote: General feedback is welcome; in particular, I need more opinions about what syntax people would like. We seem unable to find something that we really like; this is the current best candidate (cdef is the way you declare types on variables in Cython): cdef int i = 4, j = 6 cdef

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Joris De Ridder
Hi Dag, General feedback is welcome; in particular, I need more opinions about what syntax people would like. We seem unable to find something that we really like; this is the current best candidate (cdef is the way you declare types on variables in Cython): cdef int i = 4, j = 6 cdef

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 understand

Re: [Numpy-discussion] NotImplementedType should be an exception

2008-06-21 Thread Travis E. Oliphant
Charles R Harris wrote: Shouldn't this raise an NotImplementedError exception? In [7]: type(remainder(complex192(1), complex192(1))) Out[7]: type 'NotImplementedType' I'm not sure if it is relevant in this case but we do need to keep in mind that Python uses the NotImplementedType as a signal

Re: [Numpy-discussion] NotImplementedType should be an exception

2008-06-21 Thread Charles R Harris
On Sat, Jun 21, 2008 at 7:39 AM, Travis E. Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: Shouldn't this raise an NotImplementedError exception? In [7]: type(remainder(complex192(1), complex192(1))) Out[7]: type 'NotImplementedType' I'm not sure if it is relevant in this case

[Numpy-discussion] Win64 buildbot stuck?

2008-06-21 Thread Alan McIntyre
It looks like the Windows_XP_x86_64_MSVC buildbot is stuck in the build phase for some reason. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Gael Varoquaux
On Sat, Jun 21, 2008 at 08:59:25AM +0200, Dag Sverre Seljebotn wrote: The negative indices thing is potentially confusing to new users. Pex uses a different syntax (arr{i, j} for efficient array lookups) partly to make this fact very explicit. Thoughts? I don't like the different syntax. I

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Matthew Brett
Hi, Thanks a lot for the email - it's an exciting project. cdef int i = 4, j = 6 cdef np.ndarray[np.float64, 2] arr = np.zeros((10, 10), dtype=np.float64) arr[i, j] = 1 I'm afraid I'm going to pitch into an area I'm ignorant of, and I'm sorry for that, but do you think there is any way of

Re: [Numpy-discussion] NotImplementedType should be an exception

2008-06-21 Thread Charles R Harris
On Sat, Jun 21, 2008 at 8:57 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Sat, Jun 21, 2008 at 7:39 AM, Travis E. Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: Shouldn't this raise an NotImplementedError exception? In [7]: type(remainder(complex192(1), complex192(1)))

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Dag Sverre Seljebotn
Matthew Brett wrote: Hi, Thanks a lot for the email - it's an exciting project. cdef int i = 4, j = 6 cdef np.ndarray[np.float64, 2] arr = np.zeros((10, 10), dtype=np.float64) arr[i, j] = 1 I'm afraid I'm going to pitch into an area I'm ignorant of, and I'm sorry for that, but do you

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Fernando Perez
On Fri, Jun 20, 2008 at 11:50 PM, Dag Sverre Seljebotn [EMAIL PROTECTED] wrote: Since there's been a lot of Cython discussion lately I thought I'd speak up and start a thread specifically for my project. Thanks for coming over for the discussion! The code above the under the hood acquires a

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Dag Sverre Seljebotn
Joris De Ridder wrote: Hi Dag, General feedback is welcome; in particular, I need more opinions about what syntax people would like. We seem unable to find something that we really like; this is the current best candidate (cdef is the way you declare types on variables in Cython): cdef

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Dag Sverre Seljebotn
Fernando Perez wrote: On Fri, Jun 20, 2008 at 11:50 PM, Dag Sverre Seljebotn [EMAIL PROTECTED] wrote: Since there's been a lot of Cython discussion lately I thought I'd speak up and start a thread specifically for my project. Thanks for coming over for the discussion! The code above the

Re: [Numpy-discussion] NotImplementedType should be an exception

2008-06-21 Thread Charles R Harris
On Sat, Jun 21, 2008 at 12:01 PM, Charles R Harris [EMAIL PROTECTED] wrote: On Sat, Jun 21, 2008 at 8:57 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Sat, Jun 21, 2008 at 7:39 AM, Travis E. Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: Shouldn't this raise an

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Stéfan van der Walt
Hi Dag 2008/6/21 Dag Sverre Seljebotn [EMAIL PROTECTED]: However, I could make it so that if you left out the type, it would be auto-detected. I.e.: cdef np.ndarray[2] arr = ... cdef np.float64 x = arr[3,4] Would it not be possible for Cython to make the necessary C-API calls to query the

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-21 Thread Stéfan van der Walt
2008/6/20 Robert Kern [EMAIL PROTECTED]: Are they initializing different copies of the same thing? No. import numpy is essentially the same as the pure Python equivalent; it loads the module and puts it into the namespace. cnp.import_array() loads the module (or reuses the already loaded

Re: [Numpy-discussion] NotImplementedType should be an exception

2008-06-21 Thread Charles R Harris
On Sat, Jun 21, 2008 at 7:39 AM, Travis E. Oliphant [EMAIL PROTECTED] wrote: Charles R Harris wrote: Shouldn't this raise an NotImplementedError exception? In [7]: type(remainder(complex192(1), complex192(1))) Out[7]: type 'NotImplementedType' I'm not sure if it is relevant in this case

Re: [Numpy-discussion] parallel loop annotations

2008-06-21 Thread Rahul Garg
The discussion has moved to : http://wiki.cython.org/enhancements/parallel Quoting Rahul Garg [EMAIL PROTECTED]: Thanks for pointing them out. I will look into both of them. I like the with statement. From an implementation perspective, the with statement looks simpler since the Python parser

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Anne Archibald
2008/6/21 Dag Sverre Seljebotn [EMAIL PROTECTED]: Dag wrote: General feedback is welcome; in particular, I need more opinions about what syntax people would like. We seem unable to find something that we really like; this is the current best candidate (cdef is the way you declare types on

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Dag Sverre Seljebotn
Anne Archibald wrote: 2008/6/21 Dag Sverre Seljebotn [EMAIL PROTECTED]: Dag wrote: General feedback is welcome; in particular, I need more opinions about what syntax people would like. We seem unable to find something that we really like; this is the current best candidate (cdef is the way

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Rahul Garg
I am very worried about the negative numbers issue. It's the sort of thing that will readily lead to errors, and that produces a significant difference between cython and python. I understand the performance issues that motivate it, but cython really needs to be easy to use or we might as

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Matthew Brett
Hi, The feature of compiling code for multiple types is somewhat orthogonal to ndarray support; better treat them seperately and take one at the time. Well, it's relevant to numpy because if you want to implement - for example - a numpy sort, then you've got to deal with an unspecified number

Re: [Numpy-discussion] Updating cython directory to pxd usage: objections?

2008-06-21 Thread Robert Kern
On Sat, Jun 21, 2008 at 15:49, Stéfan van der Walt [EMAIL PROTECTED] wrote: 2008/6/20 Robert Kern [EMAIL PROTECTED]: Are they initializing different copies of the same thing? No. import numpy is essentially the same as the pure Python equivalent; it loads the module and puts it into the

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Robert Kern
On Sat, Jun 21, 2008 at 17:08, Anne Archibald [EMAIL PROTECTED] wrote: My suggestion is this: allow negative indices, accepting the cost in tight loops. (If bounds checking is enabled, the cost will be negligible anyway.) Provide a #pragma allowing the user to assert that a certain piece of

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Anne Archibald
2008/6/21 Robert Kern [EMAIL PROTECTED]: On Sat, Jun 21, 2008 at 17:08, Anne Archibald [EMAIL PROTECTED] wrote: My suggestion is this: allow negative indices, accepting the cost in tight loops. (If bounds checking is enabled, the cost will be negligible anyway.) Provide a #pragma allowing the

Re: [Numpy-discussion] On my Cython/NumPy project

2008-06-21 Thread Robert Kern
On Sat, Jun 21, 2008 at 18:45, Anne Archibald [EMAIL PROTECTED] wrote: 2008/6/21 Robert Kern [EMAIL PROTECTED]: On Sat, Jun 21, 2008 at 17:08, Anne Archibald [EMAIL PROTECTED] wrote: My suggestion is this: allow negative indices, accepting the cost in tight loops. (If bounds checking is

Re: [Numpy-discussion] Test framework changes

2008-06-21 Thread Charles R Harris
On Fri, Jun 20, 2008 at 6:22 PM, Alan McIntyre [EMAIL PROTECTED] wrote: On Fri, Jun 20, 2008 at 7:22 PM, Fernando Perez [EMAIL PROTECTED] wrote: It may be worth bringing it up wtih the nose guys here: http://lists.idyll.org/listinfo/testing-in-python The nose author seems very

Re: [Numpy-discussion] Test framework changes

2008-06-21 Thread Alan McIntyre
These changes are now checked in, with the changes Robert suggested: numpy.test() returns a TextTestResult object again, and coverage (if enabled) is limited to the package from which test is called. The tests still fail because the buildbots don't have nose installed, though. On Fri, Jun 20,