[Cython] overflow bug?

2015-07-14 Thread Mark Florisson
Hi, I think this might be a bug (python 3.3 + cython 0.22.1): def f(term=b"12345"): val = int('987278186585') # The below line does not work, because it treats 1 as a constant integer # in the C code (32 bit on my machine). Using 1L does work however. val -= 1 << (len(term) *

Re: [Cython] memory view creation during cascaded assignments

2014-07-05 Thread Mark Florisson
Hi Stefan, On 5 July 2014 11:34, Stefan Behnel wrote: > Hi, > > I started optimising cascaded assignments a little to reduce the > unnecessary duplication of coercions. While doing that, I found this test > in memslice.pyx: > > ''' > def cascaded_buffer_assignment(obj): > """ > >>> A = In

Re: [Cython] "relaxed_strides" test broken with NumPy 1.8

2014-01-03 Thread mark florisson
On 3 January 2014 18:22, Stefan Behnel wrote: > Hi, > > I enabled the NumPy build for our Py3.3 test runs and while I was at it, I > got it to use the latest NumPy release 1.8. This made one of the tests fail: > > """ > Traceback (most recent call last): > File ".../doctest.py", line 131

Re: [Cython] CF based type inference

2013-06-02 Thread mark florisson
On 2 June 2013 07:22, Stefan Behnel wrote: > mark florisson, 21.05.2013 15:32: >> On 21 May 2013 14:14, Vitja Makarov wrote: >>> >>> def foo(int N): >>> x = 1 >>> y = 0 >>> for i in range(N): >>> x = x * 0.1 + y

Re: [Cython] Compiler crash fix

2013-05-22 Thread mark florisson
On 22 May 2013 10:13, Nikita Nemkin wrote: > Hi, > > Someone please apply this patch (too simple for pull request): > > diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py > index 0406fad..640d002 100755 > --- a/Cython/Compiler/ExprNodes.py > +++ b/Cython/Compiler/ExprNodes.py

Re: [Cython] CF based type inference

2013-05-21 Thread mark florisson
On 21 May 2013 14:41, Vitja Makarov wrote: > > > > 2013/5/21 mark florisson >> >> On 21 May 2013 14:14, Vitja Makarov wrote: >> > >> > >> > >> > 2013/5/21 mark florisson >> >> >> >> On 21 May 2013 11:26, Vitj

Re: [Cython] CF based type inference

2013-05-21 Thread mark florisson
On 21 May 2013 14:14, Vitja Makarov wrote: > > > > 2013/5/21 mark florisson >> >> On 21 May 2013 11:26, Vitja Makarov wrote: >> > Hi! >> > >> > Recently I've started work on new type inference engine. Now it's almost >> > rea

Re: [Cython] CF based type inference

2013-05-21 Thread mark florisson
On 21 May 2013 11:26, Vitja Makarov wrote: > Hi! > > Recently I've started work on new type inference engine. Now it's almost > ready and I want to discuss it. > > It works like this: first infer type for each assignment then for whole > entry. It has some advantages over previous algorithm: > -

Re: [Cython] [PATCH] Refcount error when transposing memoryview attribute of an extension class

2013-04-12 Thread mark florisson
On 12 April 2013 13:20, Matěj Laitl wrote: > On 8. 4. 2013 Matěj Laitl wrote: > > Hi cython-devel and Mark, > > I was getting > > > > > Fatal Python error: Acquisition count is 0 (line XYZ) > > > > when I was doing > > > > > cdef class MemViewContainer: > > > cdef double[:, :] A > > > > > >

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 15:45, Nathaniel Smith wrote: > On Tue, Apr 9, 2013 at 3:32 PM, mark florisson > wrote: > > On 9 April 2013 14:55, Nikita Nemkin wrote: > >> One alternative for code reuse in large Cython projects > >> could be packaging multiple modules into one s

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 15:47, Stefan Behnel wrote: > mark florisson, 09.04.2013 16:32: > > On 9 April 2013 14:55, Nikita Nemkin wrote: > >> One alternative for code reuse in large Cython projects > >> could be packaging multiple modules into one shared library. > > &g

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 14:55, Nikita Nemkin wrote: > On Tue, 09 Apr 2013 19:33:20 +0600, mark florisson < > markflorisso...@gmail.com> wrote: > >> On 9 April 2013 14:24, Stefan Behnel wrote: >> >> mark florisson, 09.04.2013 15:13: >>> > On 9 April 2013

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 14:46, Nathaniel Smith wrote: > On Tue, Apr 9, 2013 at 2:11 PM, Stefan Behnel wrote: > > Nathaniel Smith, 09.04.2013 15:00: > >> On 9 Apr 2013 13:50, "Stefan Behnel" wrote: > >>> Nathaniel Smith, 09.04.2013 14:25: > >>> There's also the problem of dependency hell and getting rid

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 14:35, mark florisson wrote: > > > On 9 April 2013 14:33, mark florisson wrote: > >> >> >> On 9 April 2013 14:24, Stefan Behnel wrote: >> >>> mark florisson, 09.04.2013 15:13: >>> > On 9 April 2013 14:11, Stefan Behnel wr

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 14:33, mark florisson wrote: > > > On 9 April 2013 14:24, Stefan Behnel wrote: > >> mark florisson, 09.04.2013 15:13: >> > On 9 April 2013 14:11, Stefan Behnel wrote: >> >> Nathaniel Smith, 09.04.2013 15:00: >> >>> On 9 Apr 2

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 14:24, Stefan Behnel wrote: > mark florisson, 09.04.2013 15:13: > > On 9 April 2013 14:11, Stefan Behnel wrote: > >> Nathaniel Smith, 09.04.2013 15:00: > >>> On 9 Apr 2013 13:50, "Stefan Behnel" wrote: > >>>> There'

Re: [Cython] Shared Cython runtime (was: Upcoming cython/numpy breakage with stride checking)

2013-04-09 Thread mark florisson
On 9 April 2013 14:11, Stefan Behnel wrote: > Nathaniel Smith, 09.04.2013 15:00: > > On 9 Apr 2013 13:50, "Stefan Behnel" wrote: > >> Nathaniel Smith, 09.04.2013 14:25: > >> There's also the problem of dependency hell and getting rid of old > modules > >> once they are no longer used on the user

Re: [Cython] Upcoming cython/numpy breakage with stride checking

2013-04-09 Thread mark florisson
On 9 April 2013 13:09, mark florisson wrote: > > > > On 8 April 2013 13:04, Sebastian Berg wrote: > >> On Mon, 2013-04-08 at 12:31 +0200, Dag Sverre Seljebotn wrote: >> > On 04/08/2013 09:59 AM, Sebastian Berg wrote: >> > > On Mon, 2013-04-08

Re: [Cython] Upcoming cython/numpy breakage with stride checking

2013-04-09 Thread mark florisson
On 8 April 2013 13:04, Sebastian Berg wrote: > On Mon, 2013-04-08 at 12:31 +0200, Dag Sverre Seljebotn wrote: > > On 04/08/2013 09:59 AM, Sebastian Berg wrote: > > > On Mon, 2013-04-08 at 08:42 +0200, Dag Sverre Seljebotn wrote: > > >> On 04/06/2013 04:19 PM, Nathaniel Smith wrote: > > >>> Hi all

Re: [Cython] Upcoming cython/numpy breakage with stride checking

2013-04-09 Thread mark florisson
On 9 April 2013 02:04, Dave Hirschfeld wrote: > Dag Sverre Seljebotn writes: > > > > > cdef np.ndarray[double, mode='fortran'] arr > > > > that relies on PEP 3118 contiguous-flags and I did no checking myself. > > Lots of Cython code does this instead of memoryviews (I still write my > > own cod

Re: [Cython] Refcount error with fused types in classes

2013-03-17 Thread mark florisson
On 17 March 2013 16:15, Pauli Virtanen wrote: > Hi, > > Here's a snippet demonstrating a refcount error with fused types inside > classes: > > -8<- > cimport cython > > ctypedef fused some_t: > int > double > > class Foo(object): > def bar(self, some_t x): > pas

Re: [Cython] [cython-users] freelist benchmarks

2013-02-24 Thread mark florisson
On 24 February 2013 15:58, Stefan Behnel wrote: > mark florisson, 24.02.2013 15:50: >> On 24 February 2013 13:52, Stefan Behnel wrote: >>> for those who haven't notice my other e-mail, I implemented a new extension >>> type decorator "@cython.freelis

Re: [Cython] [cython-users] freelist benchmarks

2013-02-24 Thread mark florisson
On 24 February 2013 17:50, mark florisson wrote: > On 24 February 2013 15:58, Stefan Behnel wrote: >> mark florisson, 24.02.2013 15:50: >>> On 24 February 2013 13:52, Stefan Behnel wrote: >>>> for those who haven't notice my other e-mail, I implemented

Re: [Cython] Possible bug when using cython -Wextra

2013-02-14 Thread mark florisson
On 14 February 2013 05:08, Robert Bradshaw wrote: > On Thu, Feb 7, 2013 at 10:05 AM, Stefan Behnel wrote: >> Samuele Kaplun, 07.02.2013 13:00: >>> In data giovedì 7 febbraio 2013 12:11:47, Stefan Behnel ha scritto: > [...] > > def test(): > cdef int i > > for i fro

Re: [Cython] How does a fused function differ from an overloaded function?

2013-02-10 Thread mark florisson
On 9 February 2013 23:56, Stefan Behnel wrote: > mark florisson, 10.02.2013 03:25: >> On 9 February 2013 03:44, Stefan Behnel wrote: >>> Hi, >>> >>> I noticed that Cython currently fails to do this: >>> >>>cdef int (*int_abs)(int x) &

Re: [Cython] Fwd: MemoryView.is_f_contig sometimes not defined?

2013-02-09 Thread mark florisson
On 9 February 2013 07:03, David Hirschfeld wrote: > Reposting because I think my original got blocked because of > attachments. Apologies if this appears twice. > > I want to allow arbitrary C/F contiguous arrays as input to a cdef > class so I can dispatch to a different calculation method in eac

Re: [Cython] How does a fused function differ from an overloaded function?

2013-02-09 Thread mark florisson
On 9 February 2013 03:44, Stefan Behnel wrote: > Hi, > > I noticed that Cython currently fails to do this: > >cdef int (*int_abs)(int x) >cdef object py_abs >py_abs = int_abs = abs > > Here, abs() is an overloaded function with a couple of C signatures (fabs() > and friends) and a Pyth

Re: [Cython] analyse_types() refactoring

2013-02-07 Thread mark florisson
On 7 February 2013 11:32, Stefan Behnel wrote: > Hi, > > I finally found the time to refactor the analysis phase. > > https://github.com/cython/cython/commit/f9c385e08401ed96b5b0afb8411480037dc772b9 > > The methods now return a node, which allows them to replace themselves with > a different imple

Re: [Cython] "minierror" in Shadow.py?

2013-01-19 Thread mark florisson
On 19 January 2013 07:22, Stefan Behnel wrote: > Hi, > > I just wanted to release 0.18 beta1 when I noticed this code in Shadow.py, > function index_type(): > > """ > raise minierror.InvalidTypeSpecification( > "Only a step of 1 may be provided to indicate C or " >

Re: [Cython] releasing 0.18?

2013-01-13 Thread mark florisson
On 13 January 2013 06:49, Stefan Behnel wrote: > Hi, > > haven't heard from Mark yet, but would anyone object to releasing a beta in > a couple of days? > > Stefan > > ___ > cython-devel mailing list > cython-devel@python.org > http://mail.python.org/mai

Re: [Cython] releasing 0.18?

2012-12-15 Thread mark florisson
On 15 December 2012 17:34, Stefan Behnel wrote: > Hi, > > the current master doesn't really have the one new, great&shiny feature, > but I don't see a reason to keep the changes back that we have implemented > so far. Robert's const support and the integer overflow checks (assuming > that both are

Re: [Cython] (no subject)

2012-12-05 Thread mark florisson
On 5 December 2012 17:11, mark florisson wrote: > On 5 December 2012 16:54, Yaroslav Halchenko wrote: >> Thank you Bradley, >> >> This was easy enough even so that I could fix it (I think) -- just a >> typo: >> >> https://github.com/cython/cython/p

Re: [Cython] (no subject)

2012-12-05 Thread mark florisson
ey M. Froehle wrote: > >>I ran `git bisect`: >>d96dfdbb290d23bf3b4a186dc5b1b5d9ee7fcaa5 is the first bad commit >>commit d96dfdbb290d23bf3b4a186dc5b1b5d9ee7fcaa5 >>Author: Mark Florisson <[1]markflorisso...@gmail.com> >>Date: � Tue Apr 10 1

Re: [Cython] memoryview of extension types: warnings with gcc, errors with g++

2012-11-30 Thread mark florisson
On 30 November 2012 00:45, Matěj Laitl wrote: > Hi list and Mark, > it seems that C code with questionable casts is generated when using memory > views of extension types. I get following warnings from gcc: > > extension_type_memoryview.c: In function > ‘__pyx_pf_25extension_type_memoryview_test_

Re: [Cython] redefining PyIndex_Check

2012-11-11 Thread mark florisson
On 11 November 2012 14:09, mark florisson wrote: > On 11 November 2012 13:04, Stefan Behnel wrote: >> mark florisson, 11.11.2012 12:26: >>> On 11 November 2012 08:12, Stefan Behnel wrote: >>>> instead of overriding an existing definition of "PyIndex_Check&

Re: [Cython] redefining PyIndex_Check

2012-11-11 Thread mark florisson
On 11 November 2012 13:04, Stefan Behnel wrote: > mark florisson, 11.11.2012 12:26: >> On 11 November 2012 08:12, Stefan Behnel wrote: >>> instead of overriding an existing definition of "PyIndex_Check" like this: >>> >>> """ >>

Re: [Cython] redefining PyIndex_Check

2012-11-11 Thread mark florisson
On 11 November 2012 08:12, Stefan Behnel wrote: > Hi, > > instead of overriding an existing definition of "PyIndex_Check" like this: > > """ > +#if PY_VERSION_HEX < 0x0205 > +/* NumPy headers define PyIndex_Check incorrectly */ > +#undef PyIndex_Check > +#define PyIndex_Check(o) (P

Re: [Cython] Any more fixes for 0.17.2?

2012-11-10 Thread mark florisson
On 9 November 2012 20:41, Stefan Behnel wrote: > mark florisson, 07.11.2012 11:48: >> On 7 November 2012 10:47, mark florisson wrote: >>> On 6 November 2012 22:21, Stefan Behnel wrote: >>>> mark florisson, 04.11.2012 14:07: >>>>> On 4 November

Re: [Cython] Any more fixes for 0.17.2?

2012-11-07 Thread mark florisson
On 7 November 2012 10:47, mark florisson wrote: > On 6 November 2012 22:21, Stefan Behnel wrote: >> mark florisson, 04.11.2012 14:07: >>> On 4 November 2012 12:56, Stefan Behnel wrote: >>>> mark florisson, 04.11.2012 13:45: >>>> >>>>

Re: [Cython] Any more fixes for 0.17.2?

2012-11-07 Thread mark florisson
On 6 November 2012 22:21, Stefan Behnel wrote: > mark florisson, 04.11.2012 14:07: >> On 4 November 2012 12:56, Stefan Behnel wrote: >>> mark florisson, 04.11.2012 13:45: >>> >>>> It seems that some tests are failing in cython-devel >>>> since co

Re: [Cython] Custom automatic type conversions from/to C++

2012-11-05 Thread mark florisson
On 4 November 2012 22:32, Olivier Parcollet wrote: > Hello, > > I would like to write some automatic C++/python conversionsfor the > classes of my project > in addition to std::vector and others std:: objects. > > Conversions for std:: objects are written in > Cython/Utility/CppConvert.pyx, i.e. a

Re: [Cython] Any more fixes for 0.17.2?

2012-11-04 Thread mark florisson
On 4 November 2012 12:04, Stefan Behnel wrote: > > mark florisson, 04.11.2012 13:00: >>> >>> On Nov 3, 2012 4:22 PM, "Stefan Behnel" wrote: >>>> >>>> the 0.17 branch has gained a couple of fixes, so I'd like to release a >>>

Re: [Cython] Any more fixes for 0.17.2?

2012-11-04 Thread mark florisson
On 4 November 2012 12:56, Stefan Behnel wrote: > mark florisson, 04.11.2012 13:45: > >> It seems that some tests are failing in cython-devel >> since commit 'disable some Cython syntax in .py compilation mode: >> typecasts, &..., sizeof()', but you're p

Re: [Cython] Any more fixes for 0.17.2?

2012-11-04 Thread mark florisson
On 4 November 2012 12:04, Stefan Behnel wrote: > mark florisson, 04.11.2012 13:00: >>> >>> On Nov 3, 2012 4:22 PM, "Stefan Behnel" wrote: >>>> >>>> the 0.17 branch has gained a couple of fixes, so I'd like to release a >>>>

Re: [Cython] Any more fixes for 0.17.2?

2012-11-04 Thread mark florisson
On 4 November 2012 01:23, Robert Bradshaw wrote: > > On Nov 3, 2012 4:22 PM, "Stefan Behnel" wrote: >> >> Hi, >> >> the 0.17 branch has gained a couple of fixes, so I'd like to release a >> 0.17.2 some time next week. > > You read my mind. > >> In case you have other things to add to it within th

Re: [Cython] array expressions

2012-10-28 Thread mark florisson
On 23 October 2012 10:47, mark florisson wrote: > On 23 October 2012 02:44, Robert Bradshaw wrote: >> On Sun, Oct 21, 2012 at 5:39 AM, mark florisson >> wrote: >>> On 16 October 2012 18:48, Robert Bradshaw wrote: >>>> On Sun, Oct 14, 2012 at 6:13 AM, mar

Re: [Cython] array expressions

2012-10-23 Thread mark florisson
On 23 October 2012 02:44, Robert Bradshaw wrote: > On Sun, Oct 21, 2012 at 5:39 AM, mark florisson > wrote: >> On 16 October 2012 18:48, Robert Bradshaw wrote: >>> On Sun, Oct 14, 2012 at 6:13 AM, mark florisson >>> wrote: >>>> On 14 October 20

Re: [Cython] array expressions

2012-10-21 Thread mark florisson
On 21 October 2012 13:39, mark florisson wrote: > On 16 October 2012 18:48, Robert Bradshaw wrote: >> On Sun, Oct 14, 2012 at 6:13 AM, mark florisson >> wrote: >>> On 14 October 2012 14:05, Stefan Behnel wrote: >>>> mark florisson, 14.10.2012 13:59: >>

Re: [Cython] array expressions

2012-10-21 Thread mark florisson
On 16 October 2012 18:48, Robert Bradshaw wrote: > On Sun, Oct 14, 2012 at 6:13 AM, mark florisson > wrote: >> On 14 October 2012 14:05, Stefan Behnel wrote: >>> mark florisson, 14.10.2012 13:59: >>>> The problem with minivect as a package is that it caters

Re: [Cython] array expressions

2012-10-14 Thread mark florisson
On 14 October 2012 14:05, Stefan Behnel wrote: > mark florisson, 14.10.2012 13:59: >> The problem with minivect as a package is that it caters to different >> projects, which have different requirements. Cython and minivect are >> quite closely coupled, and any future change,

Re: [Cython] array expressions

2012-10-14 Thread mark florisson
On 14 October 2012 11:23, Stefan Behnel wrote: > Dag Sverre Seljebotn, 14.10.2012 11:03: >> On 10/14/2012 10:32 AM, Stefan Behnel wrote: >>> Dag Sverre Seljebotn, 14.10.2012 10:18: >>>> On 10/14/2012 08:18 AM, Stefan Behnel wrote: >>>>> mark florisson

Re: [Cython] array expressions

2012-10-14 Thread mark florisson
On 14 October 2012 09:32, Stefan Behnel wrote: > Dag Sverre Seljebotn, 14.10.2012 10:18: >> On 10/14/2012 08:18 AM, Stefan Behnel wrote: >>> mark florisson, 13.10.2012 20:30: >>>> On 12 October 2012 20:01, Dag Sverre Seljebotn wrote: >>>>> On 10/12/20

Re: [Cython] array expressions

2012-10-14 Thread mark florisson
On 14 October 2012 09:23, Dag Sverre Seljebotn wrote: > On 10/14/2012 10:18 AM, Dag Sverre Seljebotn wrote: >> >> On 10/14/2012 08:18 AM, Stefan Behnel wrote: >>> >>> mark florisson, 13.10.2012 20:30: >>>> >>>> On 12 October 2012 20:01, Da

Re: [Cython] array expressions

2012-10-13 Thread mark florisson
On 12 October 2012 20:01, Dag Sverre Seljebotn wrote: > On 10/12/2012 05:50 PM, Robert Bradshaw wrote: >> >> On Fri, Oct 12, 2012 at 3:14 AM, mark florisson >> wrote: >>> >>> On 12 October 2012 08:36, Stefan Behnel wrote: >>>> >>>

Re: [Cython] array expressions

2012-10-12 Thread mark florisson
On 12 October 2012 08:36, Stefan Behnel wrote: > mark florisson, 24.08.2012 20:40: >> Here a pull request for element-wise array expressions for Cython: >> https://github.com/cython/cython/pull/144 > > Mark, any news on this? I'd like to see a version merged before

Re: [Cython] ref-leak in 0.17

2012-09-25 Thread mark florisson
On 25 September 2012 16:48, Stefan Behnel wrote: > mark florisson, 25.09.2012 17:27: >> On 25 September 2012 16:12, Stefan Behnel wrote: >>> Stefan Behnel, 25.09.2012 14:55: >>>> there is a reference leak in the new dict iteration code in 0.17: >>>> >

Re: [Cython] ref-leak in 0.17

2012-09-25 Thread mark florisson
On 25 September 2012 16:12, Stefan Behnel wrote: > Stefan Behnel, 25.09.2012 14:55: >> there is a reference leak in the new dict iteration code in 0.17: >> >> http://trac.cython.org/cython_trac/ticket/790 >> >> I'll see if I can fix it and then release a pure bugfix 0.17.1 right >> afterwards. >>

Re: [Cython] cpdef, nogil and void return (was: [cython-users] Use the function abs in a cpdef function with nogil)

2012-09-22 Thread mark florisson
On 22 September 2012 14:03, Stefan Behnel wrote: > [CC-ing cython-devel here as this is a design issue] > > Joaquin Cuenca Abela, 21.09.2012 19:32: >> On Fri, Sep 21, 2012 at 6:12 PM, Chris Barker wrote: >>> On Fri, Sep 21, 2012 at 2:48 AM, Joaquin Cuenca Abela wrote: I don't set a return typ

Re: [Cython] [PATCH] make memoryviews work when strides is NULL (unfinished)

2012-09-19 Thread mark florisson
On 19 September 2012 08:03, Christoph Groth wrote: > Hi Mark, > >> Thanks for the patch, it looks fine to me. If you want, you could make >> a pull request and I'll merge it. > > Ok, the pull request is here: > https://github.com/cython/cython/pull/150 > > Please double-check that the dereferencin

Re: [Cython] read-only memory views

2012-09-19 Thread mark florisson
On 19 September 2012 00:15, Robert Bradshaw wrote: > On Tue, Sep 18, 2012 at 3:42 PM, mark florisson > wrote: >> On 18 September 2012 20:55, Christoph Groth wrote: >>> Hello, >>> >>> I have written a python extension module, tinyarray, (to be made public

Re: [Cython] [PATCH] make memoryviews work when strides is NULL (unfinished)

2012-09-18 Thread mark florisson
On 18 September 2012 15:19, Christoph Groth wrote: > Hi, > > Thanks a lot for the recently added generic memoryview support, it's > just what we needed to optimize an important part of our program. > > However, I believe that there's a problem with Cython's support for > objects which do not provi

Re: [Cython] read-only memory views

2012-09-18 Thread mark florisson
On 18 September 2012 20:55, Christoph Groth wrote: > Hello, > > I have written a python extension module, tinyarray, (to be made public > soon) which implements an important subset of numpy optimized for > _small_ arrays. Tinyarrays are immutable, which makes them usable as > dictionary keys. > >

Re: [Cython] Fwd: [cython-users] can pointers be stored in Python's dict or list?

2012-09-15 Thread mark florisson
On 15 September 2012 06:39, Stefan Behnel wrote: > Robert Bradshaw, 15.09.2012 00:39: >> On Fri, Sep 14, 2012 at 2:29 PM, Dag Sverre Seljebotn wrote: >>> Isn't there a case for converting to/from ctypes pointers rather than >>> capsules? And if capsules, what would the secret word be? Hmm... >> >>

Re: [Cython] Cython 0.17 beta 3 released - release candidate

2012-08-29 Thread mark florisson
On 29 August 2012 21:20, Stefan Behnel wrote: > Christoph Gohlke, 27.08.2012 18:05: >> On 8/27/2012 2:42 AM, mark florisson wrote: >>> On 27 August 2012 01:39, Christoph Gohlke wrote: >>>> On my system, the following patch fixes all the lastprivate related test >

Re: [Cython] array expressions

2012-08-27 Thread mark florisson
On 27 August 2012 12:40, Stefan Behnel wrote: > mark florisson, 27.08.2012 13:13: >> On 27 August 2012 12:06, Stefan Behnel wrote: >>> My experience with lxml tells me that it's often better to keep things >>> separate but integrated, instead of shipping them

Re: [Cython] array expressions

2012-08-27 Thread mark florisson
On 27 August 2012 12:06, Stefan Behnel wrote: > Dag Sverre Seljebotn, 27.08.2012 11:55: >> On 08/27/2012 11:53 AM, Dag Sverre Seljebotn wrote: >>> On 08/24/2012 08:40 PM, mark florisson wrote: >>>> Here a pull request for element-wise array expressions for Cython:

Re: [Cython] Cython 0.17 beta 3 released - release candidate

2012-08-27 Thread mark florisson
On 27 August 2012 01:39, Christoph Gohlke wrote: > On 8/26/2012 4:08 AM, mark florisson wrote: >> >> On 25 August 2012 03:07, Christoph Gohlke wrote: >>> >>> Hi, >>> >>> >>> On 8/24/2012 12:43 PM, Stefan Behnel wrote: >>>>

Re: [Cython] Cython 0.17 beta 3 released - release candidate

2012-08-26 Thread mark florisson
On 26 August 2012 22:25, Christoph Gohlke wrote: > On 8/26/2012 2:09 PM, Christoph Gohlke wrote: >> >> On 8/26/2012 4:08 AM, mark florisson wrote: >>> >>> On 25 August 2012 03:07, Christoph Gohlke wrote: >>>> >>>> Hi,

Re: [Cython] Cython 0.17 beta 3 released - release candidate

2012-08-26 Thread mark florisson
On 26 August 2012 22:45, mark florisson wrote: > On 26 August 2012 22:25, Christoph Gohlke wrote: >> On 8/26/2012 2:09 PM, Christoph Gohlke wrote: >>> >>> On 8/26/2012 4:08 AM, mark florisson wrote: >>>> >>>> On 25 August 2012 03:07, Christoph

Re: [Cython] Cython 0.17 beta 3 released - release candidate

2012-08-26 Thread mark florisson
On 26 August 2012 17:32, Christoph Gohlke wrote: > On 8/26/2012 4:08 AM, mark florisson wrote: >> >> On 25 August 2012 03:07, Christoph Gohlke wrote: >>> >>> Hi, >>> >>> >>> On 8/24/2012 12:43 PM, Stefan Behnel wrote: >>>>

Re: [Cython] Cython 0.17 beta 3 released - release candidate

2012-08-26 Thread mark florisson
On 25 August 2012 03:07, Christoph Gohlke wrote: > Hi, > > > On 8/24/2012 12:43 PM, Stefan Behnel wrote: >> >> Hi, >> >> thanks for testing! >> >> Christoph Gohlke, 24.08.2012 07:20: >>> >>> I tested Cython-0.17b3 on Windows 7 with Visual Studio compilers. >>> >>> 32 bit Python 2.7 works well, onl

[Cython] array expressions

2012-08-24 Thread mark florisson
Hey, Here a pull request for element-wise array expressions for Cython: https://github.com/cython/cython/pull/144 It includes the IndexNode refactoring branch as well. This has been the work this last summer for the gsoc, with great supervision from Dag, who helped steer the project in a great di

Re: [Cython] two remaining test failures before the release

2012-08-21 Thread mark florisson
On 21 August 2012 16:09, Stefan Behnel wrote: > mark florisson, 21.08.2012 13:43: >> On 21 August 2012 11:54, Robert Bradshaw wrote: >>> On Mon, Aug 20, 2012 at 11:18 PM, Stefan Behnel wrote: >>>> we are now down to two test failures in the NumPy me

Re: [Cython] two remaining test failures before the release

2012-08-21 Thread mark florisson
Heh, so it seems if numpy doesn't understand the format string it falls back to copying the array through the sequence protocol (__getitem__ + len)? Since Cython can't convert multi-dimension C arrays to objects, the memoryview getitem will use the struct module (which really handles a subset of th

Re: [Cython] C++ STL iteration bugs

2012-08-13 Thread mark florisson
On 13 August 2012 16:42, Robert Bradshaw wrote: > On Sun, Aug 12, 2012 at 3:26 AM, mark florisson > wrote: >> On 12 August 2012 08:00, Robert Bradshaw wrote: >>> On Sat, Aug 11, 2012 at 1:19 PM, Stefan Behnel wrote: >>>> Hi, >>>> >>>

Re: [Cython] C++ STL iteration bugs

2012-08-12 Thread mark florisson
On 12 August 2012 08:00, Robert Bradshaw wrote: > On Sat, Aug 11, 2012 at 1:19 PM, Stefan Behnel wrote: >> Hi, >> >> I ran into a couple of problems with the new C++ STL integration, just >> dumping them here for now. >> >> Invalid C code when using a stack allocated C++ vector inside of a >> gen

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread mark florisson
On 10 August 2012 21:27, Bradley M. Froehle wrote: > I think again this is an instance of the tests being incorrect, rather than > the code. The failing numpy_tests are all cases where we instantiate a > buffer of type 'b' (== 'signed char') but then try to use it as if it was a > 'char'. Yes, t

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread mark florisson
On 10 August 2012 19:54, Robert Bradshaw wrote: > On Fri, Aug 10, 2012 at 9:25 AM, Robert Bradshaw wrote: >> On Thu, Aug 9, 2012 at 10:04 AM, Stefan Behnel wrote: >>> mark florisson, 09.08.2012 18:51: >>>> On 9 August 2012 16:36, Stefan Behnel wrote: >>

Re: [Cython] Cython Debian builds - failing cygdb tests

2012-08-10 Thread mark florisson
On 10 August 2012 05:23, Stefan Behnel wrote: > Hi, > > Yaroslav Halchenko retried the test run on Sparc and all code related bugs > seem to be resolved now (I had to fix a few minor endianess bugs). > > However, the cygdb tests still fail, but do not lead to a test run failure. > > Yaroslav Halch

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread mark florisson
On 9 August 2012 18:04, Stefan Behnel wrote: > mark florisson, 09.08.2012 18:51: >> On 9 August 2012 16:36, Stefan Behnel wrote: >>> Stefan Behnel, 09.08.2012 14:31: >>>> mark florisson, 07.08.2012 11:09: >>>>> I thought the 32 bit issue was resolved?

Re: [Cython] remaining open issues for 0.17

2012-08-09 Thread mark florisson
On 9 August 2012 16:36, Stefan Behnel wrote: > Stefan Behnel, 09.08.2012 14:31: >> mark florisson, 07.08.2012 11:09: >>> I thought the 32 bit issue was resolved? You pushed a fix and I fixed >>> some tests, so it passed for me. I can run it again to check... >>

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread mark florisson
On 7 August 2012 11:59, mark florisson wrote: > On 7 August 2012 11:44, Stefan Behnel wrote: >> mark florisson, 07.08.2012 12:33: >>> I'd say write a wrapper function that does the check, or use an object >>> that encapsulates the buffer allocation and functions.

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread mark florisson
On 7 August 2012 11:44, Stefan Behnel wrote: > mark florisson, 07.08.2012 12:33: >> I'd say write a wrapper function that does the check, or use an object >> that encapsulates the buffer allocation and functions. I'm not sure >> we'd want extra syntax fo

Re: [Cython] automatically raise MemoryError on exceptional C return values

2012-08-07 Thread mark florisson
On 7 August 2012 10:53, Stefan Behnel wrote: > Hi, > > given how ubiquitous manual memory management is in C, I think it would be > nice to let Cython generate the exception raising also for C, not only for > C++. The difference is this: > > cdef extern from "...": > char* make_new_buffer(

Re: [Cython] remaining open issues for 0.17

2012-08-07 Thread mark florisson
On 6 August 2012 22:58, Stefan Behnel wrote: > Hi, > > please correct me if I'm missing something, but besides the fused types > default value thing, I currently see two open issues for 0.17. One is the > 32bit problem we have in the buffer code, the other one is the "vile hack" > that Robert adde

Re: [Cython] [cython-users] Re: Cython 0.17 beta 1 released

2012-08-01 Thread mark florisson
On 31 July 2012 20:14, Stefan Behnel wrote: > Robert Bradshaw, 31.07.2012 19:24: >> On Tue, Jul 31, 2012 at 7:24 AM, Stefan Behnel wrote: >>> mark florisson, 28.07.2012 14:04: >>>> On 27 July 2012 23:30, Bradley Froehle wrote: >>>>> Thanks t

Re: [Cython] [cython-users] Re: Cython 0.17 beta 1 released

2012-07-28 Thread mark florisson
On 27 July 2012 23:30, Bradley Froehle wrote: > Thanks to the work of Yaroslav Halchenko, there is an experimental Debian > package for Cython 0.17.beta1 -- http://packages.qa.debian.org/c/cython.html > > However, the builds are showing a lot of test failures on non-amd64 sytems. > See https://bui

Re: [Cython] Bug, or changed array assignment in 0.17beta1?

2012-07-25 Thread mark florisson
On 25 July 2012 07:29, Stefan Behnel wrote: > Stefan Behnel, 25.07.2012 07:40: >> Mike Zaletel, 25.07.2012 00:40: >>> bug.pyx-- >>> >>> def foo(): >>>cdef int i >>>cdef int* p1 = [4, 4] >>>cdef int* p2 = [5, 5] >>> >>>print "p1:", >>>for i in

Re: [Cython] Type inference and C++

2012-07-23 Thread mark florisson
On 23 July 2012 20:28, Vitja Makarov wrote: > 2012/7/23 Vitja Makarov : >> Here is part of original testcase: >> >> from cython.operator cimport dereference as d >> from cython.operator cimport preincrement as incr >> from libcpp.vector cimport vector >> >> def reverse_iteration_test(L): >> v

Re: [Cython] merging _refactor_indexnode branch

2012-07-23 Thread mark florisson
On 23 July 2012 19:55, Stefan Behnel wrote: > mark florisson, 23.07.2012 20:07: >> On 23 July 2012 18:54, Stefan Behnel wrote: >>> mark florisson, 17.07.2012 12:20: >>>> On 17 July 2012 10:02, Stefan Behnel wrote: >>>>> mark florisson, 10.07.2012

Re: [Cython] merging _refactor_indexnode branch

2012-07-23 Thread mark florisson
On 23 July 2012 19:07, mark florisson wrote: > On 23 July 2012 18:54, Stefan Behnel wrote: >> mark florisson, 17.07.2012 12:20: >>> On 17 July 2012 10:02, Stefan Behnel wrote: >>>> mark florisson, 10.07.2012 11:20: >>>>> Do you want _refactor_indexnod

Re: [Cython] merging _refactor_indexnode branch

2012-07-23 Thread mark florisson
On 23 July 2012 18:54, Stefan Behnel wrote: > mark florisson, 17.07.2012 12:20: >> On 17 July 2012 10:02, Stefan Behnel wrote: >>> mark florisson, 10.07.2012 11:20: >>>> Do you want _refactor_indexnode merged for this release? >>> >>> I was ok w

Re: [Cython] planning for 0.17

2012-07-21 Thread mark florisson
On 26 June 2012 21:36, Stefan Behnel wrote: > Hi, > > I'd like to get an idea of what's still open for 0.17. > > Mark mentioned some open memoryview issues on his list and I know that > there are still issues with PyPy, some of which could get fixed in a > reasonable time frame. Also, Jenkins isn'

Re: [Cython] failing memory view tests in Python 2.4/5

2012-07-17 Thread mark florisson
On 17 July 2012 12:12, Stefan Behnel wrote: > mark florisson, 17.07.2012 12:15: >> On 17 July 2012 09:58, Stefan Behnel wrote: >>> mark florisson, 10.07.2012 11:20: >>>> Perhaps we should run >>>> the 2x tests from py27 down to 2.4. Tests in n

Re: [Cython] merging _refactor_indexnode branch (was: failing memory view tests in Python 2.4/5)

2012-07-17 Thread mark florisson
On 17 July 2012 10:02, Stefan Behnel wrote: > mark florisson, 10.07.2012 11:20: >> Do you want _refactor_indexnode merged for this release? > > I was ok with it when I first skipped over it. It would be good to give it > another pair of eyeballs, but apart from that, yes, I

Re: [Cython] failing memory view tests in Python 2.4/5

2012-07-17 Thread mark florisson
On 17 July 2012 09:58, Stefan Behnel wrote: > mark florisson, 10.07.2012 11:20: >> On 10 July 2012 08:24, Stefan Behnel wrote: >>> I've fixed some of the errors that current block the tests. The remaining >>> failures in the memory view tests exist in both Py2

Re: [Cython] failing memory view tests in Python 2.4/5

2012-07-10 Thread mark florisson
On 10 July 2012 08:24, Stefan Behnel wrote: > Hi, > > I've fixed some of the errors that current block the tests. The remaining > failures in the memory view tests exist in both Py2.4 and 2.5, which hints > at a problem with the buffer support in numpy.pxd. > > https://sage.math.washington.edu:809

Re: [Cython] [cython-users] C++: how to handle failures of 'new'?

2012-07-08 Thread mark florisson
On 8 July 2012 11:17, Stefan Behnel wrote: > mark florisson, 08.07.2012 11:34: >> On 8 July 2012 08:59, Robert Bradshaw wrote: >>> On Fri, Jul 6, 2012 at 2:33 AM, mark florisson wrote: >>>> On 6 July 2012 03:34, Dag Sverre Seljebotn wrote: >>>>> I'

Re: [Cython] [cython-users] C++: how to handle failures of 'new'?

2012-07-08 Thread mark florisson
On 8 July 2012 08:59, Robert Bradshaw wrote: > On Fri, Jul 6, 2012 at 2:33 AM, mark florisson > wrote: >> On 6 July 2012 03:34, Dag Sverre Seljebotn >> wrote: >>> >>> >>> mark florisson wrote: >>> >>>>On 5 July 2012 21:46,

Re: [Cython] [cython-users] C++: how to handle failures of 'new'?

2012-07-06 Thread mark florisson
On 6 July 2012 03:34, Dag Sverre Seljebotn wrote: > > > mark florisson wrote: > >>On 5 July 2012 21:46, Dag Sverre Seljebotn >>wrote: >>> >>> >>> mark florisson wrote: >>> >>>>On 3 July 2012 20:15, Robert Bradshaw wrote:

  1   2   3   4   5   6   7   >