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

2012-08-09 Thread Robert Bradshaw
On Wed, Aug 8, 2012 at 10:12 PM, Stefan Behnel wrote: > Robert Bradshaw, 09.08.2012 01:45: >> On Tue, Aug 7, 2012 at 2:53 AM, Stefan Behnel wrote: >>> given how ubiquitous manual memory management is in C, I think it would be >>> nice to let Cython generate the except

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread Robert Bradshaw
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: >>> 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 > so

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread Robert Bradshaw
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: >>>> Stefan Behnel, 09.08.2012 14:31: >>>>> mark flor

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread Robert Bradshaw
On Fri, Aug 10, 2012 at 12:10 PM, Stefan Behnel wrote: > Robert Bradshaw, 10.08.2012 20:54: >> OK, the problem boiled down to using 'b' or 'B' for the format string >> for char rather than 'c'. See, e.g. >> http://docs.python.org/library/arra

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread Robert Bradshaw
On Fri, Aug 10, 2012 at 12:31 PM, Robert Bradshaw wrote: > On Fri, Aug 10, 2012 at 12:10 PM, Stefan Behnel wrote: >> Robert Bradshaw, 10.08.2012 20:54: >>> OK, the problem boiled down to using 'b' or 'B' for the format string >>> for char rather

Re: [Cython] remaining open issues for 0.17

2012-08-10 Thread Robert Bradshaw
We have plenty of non-transitive coercions. E.g. char* <-> object <-> float. While it's technically more correct to use signed or unsigned char, char* is pretty ubiquitous in the C world. There's also the question of the python bytes object and array.array("c") which would be good to support. And t

Re: [Cython] C++ STL iteration bugs

2012-08-11 Thread Robert Bradshaw
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 > generator, also lacking type conversion utility code: > > htt

Re: [Cython] C++ STL iteration bugs

2012-08-11 Thread Robert Bradshaw
On Sat, Aug 11, 2012 at 10:03 PM, 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 us

Re: [Cython] C++ STL iteration bugs

2012-08-12 Thread Robert Bradshaw
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 > generator, also lacking type conversion utility code: > > htt

Re: [Cython] C++ STL iteration bugs

2012-08-13 Thread Robert Bradshaw
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, >>> >>> I ran into a couple of problems with the new C++ STL integration, just >>&g

Re: [Cython] new arrayarray.h header file not C99 compatible

2012-08-20 Thread Robert Bradshaw
On Mon, Aug 20, 2012 at 6:39 AM, Stefan Behnel wrote: > Hi, > > I'm getting test build failures with the new arrayarray.h header file when > I enable "--std=c89" or "c99" in the CFLAGS: > > """ > memoryview_inplace_division.c:877: warning: declaration does not declare > anything > memoryview_inpla

Re: [Cython] new arrayarray.h header file not C99 compatible

2012-08-20 Thread Robert Bradshaw
On Mon, Aug 20, 2012 at 9:10 AM, Stefan Behnel wrote: > Robert Bradshaw, 20.08.2012 17:54: >> On Mon, Aug 20, 2012 at 6:39 AM, Stefan Behnel wrote: >>> I'm getting test build failures with the new arrayarray.h header file when >>> I enable &q

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

2012-08-21 Thread Robert Bradshaw
I fixed one of them by making char signed. The root issue seems to be that when trying to convert an object to numpy, it looks at the buffer format, and rejects plain char. The fallback code (using struct et al) is unable to cope with the nested/repeated formats. The other could be fixed similarly,

Re: [Cython] array expressions

2012-08-27 Thread Robert Bradshaw
On Mon, Aug 27, 2012 at 5:47 AM, Dag Sverre Seljebotn wrote: > On 08/27/2012 02:45 PM, Dag Sverre Seljebotn wrote: >> >> On 08/27/2012 02:05 PM, Stefan Behnel wrote: >>> >>> mark florisson, 27.08.2012 13:52: On 27 August 2012 12:40, Stefan Behnel wrote: > > mark florisson, 27.08

Re: [Cython] [cython-users] Cython 0.17 final released

2012-09-01 Thread Robert Bradshaw
I'm assuming cython-devel is a proper subset of cython-users, but just wanted to say hooray and thanks for all the work that wen into this release (both new development and pushing the actual release to completion). Is there a plan to announce more broadly? (E.g. python-announce, if you haven't al

Re: [Cython] Cython 0.17 final released

2012-09-02 Thread Robert Bradshaw
On Sat, Sep 1, 2012 at 11:49 PM, Stefan Behnel wrote: > Robert Bradshaw, 02.09.2012 06:05: >> Is there a plan to announce more broadly? (E.g. python-announce, if >> you haven't already (moderation adds a bit of latency).) > > I had already sent it to the python-anno

Re: [Cython] Non-profit 501(c)(1) Cython foundation

2012-09-04 Thread Robert Bradshaw
Sorry, that's 501(c)(3) (charitable org). On Tue, Sep 4, 2012 at 5:51 PM, Robert Bradshaw wrote: > NumFOCUS has graciously offered to help Cython get non-profit US tax > status as part of their application as a part of a "Group Exception." > Basically, this gives us a

Re: [Cython] Fwd: [numpy] MAINT: silence Cython warnings about changes dtype/ufunc size. (#432)

2012-09-08 Thread Robert Bradshaw
On Sat, Sep 8, 2012 at 2:01 PM, Dag Sverre Seljebotn wrote: > > > Nathaniel Smith wrote: > >>Hi Cythoneers, >> >>Ralf just proposed this pull request for numpy, to unconditionally >>install >>a warning filter to silence all "numpy.dtype size changed", >>"numpy.ufunc >>size changed" warnings that

Re: [Cython] Cython 0.17 final released

2012-09-11 Thread Robert Bradshaw
On Mon, Sep 10, 2012 at 5:41 PM, Fernando Perez wrote: > First, congratulations and thanks for keeping such an important > project moving forward!! > > On Sun, Sep 2, 2012 at 12:17 AM, Robert Bradshaw wrote: >> >> What about making a 0.17 branch, on which we can do 0.17

Re: [Cython] usage does not match the options

2012-09-12 Thread Robert Bradshaw
On Wed, Sep 12, 2012 at 5:36 AM, B. Clausius wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I found that the options shown by "cython -h" are different to the > options parsed by cython. > > Usage: --warning-error > Parser: --warning-errors > The parser does not recognize "-q

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

2012-09-14 Thread Robert Bradshaw
isn't as easily done as a library (especially given the 2/3 differences). - Robert -- Forwarded message ------ From: Robert Bradshaw Date: Fri, Sep 14, 2012 at 1:11 PM Subject: Re: [cython-users] can pointers be stored in Python's dict or list? To: Mark Summerfield

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

2012-09-14 Thread Robert Bradshaw
.5, but I don't think that's a huge blocker as it can be installed earlier. > Robert Bradshaw wrote: >> >> Given the CObject vs Capsule differences in Py2 vs Py3, and the >> clumsiness in using them (see below), any thoughts on automatically >> converting v

Re: [Cython] Cython 0.17 final released

2012-09-17 Thread Robert Bradshaw
On Sun, Sep 16, 2012 at 1:48 PM, Yaroslav Halchenko wrote: > > On Sat, 01 Sep 2012, Stefan Behnel wrote: >> Release notes: http://wiki.cython.org/ReleaseNotes-0.17 > > http://wiki.cython.org/ReleaseHistory > references only 0.16 for me > ;-) Fixed. ___

Re: [Cython] read-only memory views

2012-09-18 Thread Robert Bradshaw
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 >> soon) which implements an important subset of numpy optimized for >> _small_ arrays. Tinyarrays a

Re: [Cython] read-only memory views

2012-09-19 Thread Robert Bradshaw
On Wed, Sep 19, 2012 at 12:06 AM, Christoph Groth wrote: > Robert Bradshaw > writes: > >> Coincidentally, I actually implemented rudimentary const support a >> couple of days ago. It's not perfect, but at least it allows you to >> provide the correct declarations

Re: [Cython] Auto-pickle progress?

2012-09-20 Thread Robert Bradshaw
On Thu, Sep 20, 2012 at 12:11 PM, Ian Bell wrote: > There is a proposal for auto-pickling of Cython extension types: > http://wiki.cython.org/enhancements/pickling > > I was wondering whether there has been any progress on this front? > > Auto-pickling would be tremendously helpful as pickling and

Re: [Cython] Auto-pickle progress?

2012-09-25 Thread Robert Bradshaw
On Tue, Sep 25, 2012 at 5:41 AM, Ian Bell wrote: > I agree that some of the more powerful elements of Cython would be/are > difficult or impossible to pickle in a general way. I have a counter > use-case where auto-pickling would be very useful. > > I have cdef classes that have many (think 50-10

Re: [Cython] ref-leak in 0.17

2012-09-26 Thread Robert Bradshaw
On Wed, Sep 26, 2012 at 12:28 AM, Stefan Behnel wrote: > mark florisson, 25.09.2012 22:37: 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/cyth

Re: [Cython] Cython 0.17 final released

2012-09-29 Thread Robert Bradshaw
On Sat, Sep 29, 2012 at 4:08 PM, Yaroslav Halchenko wrote: > > On Tue, 25 Sep 2012, Stefan Behnel wrote: >> > Any chance we can tag the official 0.17 release in Github as well? >> BTW, do we use lightweight tags or annotated tags in git? And why? > > you should use annotated -a (and/or signed -s,

Re: [Cython] changelog for regular releases (was: ref-leak in 0.17)

2012-09-29 Thread Robert Bradshaw
On Fri, Sep 28, 2012 at 5:36 AM, Stefan Behnel wrote: > Robert Bradshaw, 26.09.2012 10:10: >> Also, on a more general note, I would rather err towards more small >> bugfix releases (when impactful bugs come up) instead of the pattern >> we've fallen into of only relea

Re: [Cython] import relative cimport

2012-10-01 Thread Robert Bradshaw
On Mon, Oct 1, 2012 at 4:43 AM, Christoph Groth wrote: > Hello, > > I believe that relative cimports would be useful in Cython. (For a > motivation, see my recent posting on cython-user > http://thread.gmane.org/gmane.comp.python.cython.user/7401) > > So I tried to assess how much work it would b

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

2012-10-11 Thread Robert Bradshaw
Don't know how I missed this earlier. On Fri, Sep 14, 2012 at 10:39 PM, 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 rath

Re: [Cython] array expressions

2012-10-12 Thread Robert Bradshaw
On Fri, Oct 12, 2012 at 3:14 AM, mark florisson wrote: > 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

Re: [Cython] array expressions

2012-10-16 Thread Robert Bradshaw
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 to different >>> projects, which have different requirements. Cython and minivect are >>> quite

Re: [Cython] mypy

2012-10-18 Thread Robert Bradshaw
On Thu, Oct 18, 2012 at 9:31 AM, Stefan Behnel wrote: > mark florisson, 18.10.2012 12:56: >> Has anyone looked at this yet? >> http://www.mypy-lang.org/index.html > > From a quick glance, they use future tense a lot on their site. It's easy > to state what you would like to have at some point. We

Re: [Cython] array expressions

2012-10-22 Thread Robert Bradshaw
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 2012 14:05, Stefan Behnel wrote: >>>> mark florisson, 14.10.2012 13:59:

Re: [Cython] provision to name cython binaries

2012-10-29 Thread Robert Bradshaw
No, but we'd welcome a patch. On Sun, Oct 28, 2012 at 8:44 AM, Neal Becker wrote: > Does cython build have a provision to name the binaries, with a suffix? This > would make it easier to build co-existing versions for python2 and 3. > > For example: > > setup.py --suffix=3 > > to produce > > ...

Re: [Cython] Any more fixes for 0.17.2?

2012-11-03 Thread Robert Bradshaw
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 the next few days, please do, or send a quick reply if you'd like to

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

2012-11-05 Thread Robert Bradshaw
On Mon, Nov 5, 2012 at 7:00 AM, Stefan Behnel wrote: > mark florisson, 05.11.2012 12:02: >> On 4 November 2012 22:32, Olivier Parcollet wrote: >>> I would like to write some automatic C++/python conversionsfor the >>> classes of my project >>> in addition to std::vector and others std:: objects. >

Re: [Cython] Any more fixes for 0.17.2?

2012-11-12 Thread Robert Bradshaw
On Sun, Nov 11, 2012 at 11:25 PM, Stefan Behnel wrote: > Stefan Behnel, 04.11.2012 00:22: >> the 0.17 branch has gained a couple of fixes, so I'd like to release a >> 0.17.2 some time next week. In case you have other things to add to it >> within the next few days, please do, or send a quick repl

Re: [Cython] Broken C++ compile test

2012-12-07 Thread Robert Bradshaw
On Fri, Dec 7, 2012 at 12:48 AM, Stefan Behnel wrote: > Stefan Behnel, 07.12.2012 09:13: >> the question by Czarek Tomczak on the users list made me stumble into this >> old C++ test: >> >> https://github.com/cython/cython/blob/master/tests/compile/cpp_operators.pyx >> >> It's completely broken an

Re: [Cython] unused function '__pyx_pw_5numpy_7ndarray_1__getbuffer__'

2012-12-10 Thread Robert Bradshaw
Thanks! Merged. On Mon, Dec 10, 2012 at 12:08 PM, Bradley M. Froehle wrote: > I've been noticing some unused function warnings of the following variety: > >> test.cpp:1189:12: warning: unused function >> '__pyx_pw_5numpy_7ndarray_1__getbuffer__' [-Wunused-function] >> static int __pyx_pw_5numpy_7

Re: [Cython] releasing 0.18?

2012-12-16 Thread Robert Bradshaw
On Sat, Dec 15, 2012 at 9:34 AM, 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 bo

Re: [Cython] Cython 0.17.2 released

2012-12-20 Thread Robert Bradshaw
On Thu, Dec 20, 2012 at 10:02 AM, Yaroslav Halchenko wrote: > > On Fri, 14 Dec 2012, Stefan Behnel wrote: >> Yaroslav Halchenko, 03.12.2012 17:23: >> > shouldn't there be >> > http://wiki.cython.org/ReleaseNotes-0.17.2 >> > ? ;-) > >> You can copy it over from >> https://github.com/cython/cython/b

[Cython] Cython 0.17.4 released.

2013-01-03 Thread Robert Bradshaw
I've just released Cython 0.17.4, which can be downloaded from http://cython.org or pypi. It's a minor bug fix release, fixing a double-allocation bug uncovered in Sage (see https://groups.google.com/forum/?hl=en&fromgroups=#!msg/sage-devel/Wt7uxbDkh_A/4qhfm2ukBR0Jfor more details). - Robert _

Re: [Cython] releasing 0.18?

2013-01-03 Thread Robert Bradshaw
On Sat, Dec 15, 2012 at 4:18 PM, mark florisson wrote: > 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 c

Re: [Cython] Potential 32bit linux issue

2013-01-05 Thread Robert Bradshaw
You ned to declare INT64_MIN as a long long. Enums are of type int. On Jan 5, 2013 5:17 PM, "Dieter Vandenbussche" wrote: > Hi, this is my first time posting to this list, hopefully i'm not wasting > anyone's time. > > i believe i may have encountered an issue on 32bit linux using cython. > > Her

Re: [Cython] releasing 0.18?

2013-01-14 Thread Robert Bradshaw
On Sun, Jan 13, 2013 at 12:27 PM, mark florisson wrote: > 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 > > > > ___ > > c

Re: [Cython] [cython-users] Recommendations for efficient typed arrays in Cython?

2013-02-04 Thread Robert Bradshaw
On Mon, Feb 4, 2013 at 4:12 AM, Sturla Molden wrote: > On 02.02.2013 01:23, Greg Ewing wrote: > >> If you're suggesting that 'def object foo' should give Python >> reference semantics and 'cdef object foo' raw C pointer >> semantics, > > > No I was not. > > I was suggesting that static declaration

Re: [Cython] analyse_types() refactoring

2013-02-09 Thread Robert Bradshaw
On Thu, Feb 7, 2013 at 1:04 PM, Dag Sverre Seljebotn wrote: > On 02/07/2013 06:32 PM, 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

Re: [Cython] Fused types don't work with cdef classes?

2013-02-13 Thread Robert Bradshaw
Yes, this is a bug; there is a bad interaction between fused types and special methods. I created http://trac.cython.org/cython_trac/ticket/802 On Fri, Feb 8, 2013 at 8:54 AM, Dave Hirschfeld wrote: > Is this a bug? > The following code fails to compile on windows VS2012, 32bit Python2.7 with a

Re: [Cython] SIGSEGV in __Pyx_CyFunction_traverse

2013-02-13 Thread Robert Bradshaw
Thanks. On Tue, Feb 5, 2013 at 11:56 AM, J Robert Ray wrote: > I was getting a crash during module init of a cython module if a garbage > collection happens between a call to __Pyx_CyFunction_InitDefaults and the > code to populate the defaults. > > The attached patch fixes the crash. This bug af

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

2013-02-13 Thread Robert Bradshaw
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 from 0 <= i < 10: print "foo" [...] >>> >

Re: [Cython] Two generators in one function

2013-02-13 Thread Robert Bradshaw
This is due to the archaic --disable-function-redefinition flag. On Mon, Feb 4, 2013 at 4:28 PM, David Roe wrote: > Hi everyone, > I ran into the following problem using Cython 0.17.4 (current version of > Sage). > > If you try to compile a file with the following function in it: > > def test_dou

Re: [Cython] To Add datetime.pxd to cython.cpython

2013-02-22 Thread Robert Bradshaw
These could be provided as inline functions in the pxd rather rather than adding another hack like we did for array. On Thu, Feb 21, 2013 at 11:01 PM, ZS wrote: > Extended part is in datetime_ex.h: > > #include "datetime.h" > > #define PyDateTime_FromDateAndTimeEx(year, month, day, hour, min, sec

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

2013-02-26 Thread Robert Bradshaw
On Mon, Feb 25, 2013 at 1:17 AM, Stefan Behnel wrote: > Hi, > > thanks for looking through it. > > David Roe, 25.02.2013 00:00: >> I changed the current type pointer check to look at tp_basicsize instead. >> >>> That made it work for almost all classes in lxml's own Element hierarchy, >>> with onl

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

2013-02-27 Thread Robert Bradshaw
On Tue, Feb 26, 2013 at 11:24 PM, Stefan Behnel wrote: > Robert Bradshaw, 26.02.2013 21:16: >> On Mon, Feb 25, 2013 at 1:17 AM, Stefan Behnel wrote: >>> David Roe, 25.02.2013 00:00: >>>> I changed the current type pointer check to look at tp_basicsize instead. &g

Re: [Cython] freelist benchmarks

2013-02-27 Thread Robert Bradshaw
On Wed, Feb 27, 2013 at 5:09 AM, Stefan Behnel wrote: > Robert Bradshaw, 27.02.2013 09:54: >> On Tue, Feb 26, 2013 at 11:24 PM, Stefan Behnel wrote: >>> I imagine that the freelist could leave the initial vtable untouched in >>> some cases, but that would mean that we

Re: [Cython] Be more forgiving about memoryview strides

2013-02-28 Thread Robert Bradshaw
On Thu, Feb 28, 2013 at 7:13 AM, Sebastian Berg wrote: > Hey, > > Maybe someone here already saw it (I don't have a track account, or I > would just create a ticket), but it would be nice if Cython was more > forgiving about contiguous requirements on strides. In the future this > would make it ea

Re: [Cython] Be more forgiving about memoryview strides

2013-02-28 Thread Robert Bradshaw
On Thu, Feb 28, 2013 at 11:12 AM, Nathaniel Smith wrote: > On Thu, Feb 28, 2013 at 5:50 PM, Robert Bradshaw wrote: >> On Thu, Feb 28, 2013 at 7:13 AM, Sebastian Berg >> wrote: >>> Hey, >>> >>> Maybe someone here already saw it (I don't have a tra

Re: [Cython] About IndexNode and unicode[index]

2013-03-01 Thread Robert Bradshaw
On Thu, Feb 28, 2013 at 10:54 PM, Zaur Shibzukhov wrote: I think you could even pass in two flags, one for wraparound and one for boundscheck, and then just evaluate them appropriately in the existing "if" tests above. That should allow both features to be supported independent

Re: [Cython] Be more forgiving about memoryview strides

2013-03-01 Thread Robert Bradshaw
On Fri, Mar 1, 2013 at 7:56 AM, Sebastian Berg wrote: > On Thu, 2013-02-28 at 23:25 -0800, Robert Bradshaw wrote: >> On Thu, Feb 28, 2013 at 11:12 AM, Nathaniel Smith wrote: >> > On Thu, Feb 28, 2013 at 5:50 PM, Robert Bradshaw >> > wrote: >> >> On Thu,

Re: [Cython] Two minor bugs

2013-03-02 Thread Robert Bradshaw
On Fri, Mar 1, 2013 at 10:52 PM, Nikita Nemkin wrote: > Hi, > > I'm new to this list and to Cython internals. > > Reporting two recently found bugs: > > 1. Explicit cast fails unexpectedly: > >ctypedef char* LPSTR >cdef LPSTR c_str = b"ascii" >c_str # Failure: Python obje

Re: [Cython] Cython syntax to pre-allocate lists for performance

2013-03-07 Thread Robert Bradshaw
On Thu, Mar 7, 2013 at 6:48 AM, Stefan Behnel wrote: > Zaur Shibzukhov, 07.03.2013 15:39: >> 2013/3/7 Zaur Shibzukhov >> >>> I guess the problem is to construct new (even empty) list with >>> pre-allocated memory exactly for N elements. >>> >>> N*[NULL] - changes semantics because there can't be l

Re: [Cython] Cython syntax to pre-allocate lists for performance

2013-03-07 Thread Robert Bradshaw
On Thu, Mar 7, 2013 at 10:26 AM, Yury V. Zaytsev wrote: > Hi Stefan, > > On Thu, 2013-03-07 at 12:21 +0100, Stefan Behnel wrote: > >> Note that Python has an algorithm for shrinking a list on appending, so >> this might not be sufficient for your use case. What do you need it for? > > W00t! I didn

Re: [Cython] Cython syntax to pre-allocate lists for performance

2013-03-07 Thread Robert Bradshaw
On Thu, Mar 7, 2013 at 3:19 PM, Greg Ewing wrote: > Nikita Nemkin wrote: >> >> Sorry, accidental early send. Previous mail continued... >> >> [None] * N makes an extra pass over the list to assign None to each item >> (and also incref None n times). > > > Maybe this could be optimised by adding N

Re: [Cython] Template functions

2013-03-16 Thread Robert Bradshaw
On Sat, Mar 16, 2013 at 10:16 AM, John Tyree wrote: > There is currently a void in Cython's C++ support with respect to function > (not > class) templates. It would be great to have such a thing, dangerous or not, so > I'm proposing something to get things rolling. > > Given that function templat

Re: [Cython] Template functions

2013-03-18 Thread Robert Bradshaw
On Sun, Mar 17, 2013 at 12:15 PM, John Tyree wrote: >> >> I was thinking of something along the lines of >> >> cdef extern from ...: >> cpp_string to_string[T](T value) >> T my_func[T, S](T a, S b) >> ... >> >> It's more a question of how to implement it. >> >> - Robert > > Well this c

Re: [Cython] timeframe for 0.19?

2013-03-25 Thread Robert Bradshaw
Sound good to me. On Sun, Mar 24, 2013 at 10:02 AM, Stefan Behnel wrote: > Hi, > > the current master has collected quite a number of improvements and I think > we should try to get them out of the door. Any objections to starting with > the preparations in the first week of April? > > Stefan > _

Re: [Cython] Bug: Returning real value crashes the code, complex value does not

2013-03-26 Thread Robert Bradshaw
On Tue, Mar 26, 2013 at 2:52 AM, Martin Fiers wrote: > Dear Cython developers, > > I stumbled upon a strange error when using Cython. I made a minimal working > example, see attachment for the two necessary files. (btw I didn't find the > e-mail address of Robert Bradshaw so

Re: [Cython] Bug: Returning real value crashes the code, complex value does not

2013-03-27 Thread Robert Bradshaw
On Wed, Mar 27, 2013 at 2:44 AM, Martin Fiers wrote: > On 3/27/2013 3:54 AM, Robert Bradshaw wrote: >> >> On Tue, Mar 26, 2013 at 5:12 PM, Martin Fiers >> wrote: >>> >>> On 3/26/2013 6:48 PM, Robert Bradshaw wrote: >>>> >>>

Re: [Cython] Constant pointers not working

2013-04-02 Thread Robert Bradshaw
Looks good to me. On Tue, Apr 2, 2013 at 10:20 AM, Volker Mische wrote: > On 03/22/2013 02:47 PM, Volker Mische wrote: >> Hi all, >> >> I was excited to see that 'const' is finally supported, but constant >> pointers are not. Here's an example with the corresponding error: >> >> Error compiling C

Re: [Cython] [cython-users] ANN: XDress v0.1 -- Automatic Code Generator and C/C++ Wrapper

2013-04-07 Thread Robert Bradshaw
First off, let me say that this is very cool! On Tue, Apr 2, 2013 at 12:52 PM, Anthony Scopatz wrote: > On Tue, Apr 2, 2013 at 2:17 PM, Dag Sverre Seljebotn > wrote: >> >> [Crossing over to cython-devel to discuss further development] >> >> Wow, my first impression is this looks great! > > > Tha

Re: [Cython] Shared Cython runtime

2013-04-09 Thread Robert Bradshaw
On Tue, Apr 9, 2013 at 8:21 AM, Stefan Behnel wrote: > Stefan Behnel, 09.04.2013 17:12: >> mark florisson, 09.04.2013 16:51: >>> 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

Re: [Cython] Constant pointers not working

2013-04-09 Thread Robert Bradshaw
On Mon, Apr 8, 2013 at 4:56 AM, Stefan Behnel wrote: > Volker Mische, 08.04.2013 13:43: >> On 04/02/2013 07:20 PM, Volker Mische wrote: >>> On 03/22/2013 02:47 PM, Volker Mische wrote: Hi all, I was excited to see that 'const' is finally supported, but constant pointers are not

Re: [Cython] Shared Cython runtime

2013-04-09 Thread Robert Bradshaw
On Tue, Apr 9, 2013 at 11:35 AM, Stefan Behnel wrote: > Robert Bradshaw, 09.04.2013 20:16: >> On Tue, Apr 9, 2013 at 8:21 AM, Stefan Behnel wrote: >>> Stefan Behnel, 09.04.2013 17:12: >>>> mark florisson, 09.04.2013 16:51: >>>>> On 9 April 2013

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

2013-04-09 Thread Robert Bradshaw
On Tue, Apr 9, 2013 at 7:22 AM, Nathaniel Smith wrote: > On Tue, Apr 9, 2013 at 3:15 PM, Stefan Behnel wrote: >> Ok, got it now. That solves the distribution problem, assuming that all >> installed runtimes with a given version are equivalent. Basically, we'd >> move the code out and then cimport

Re: [Cython] Shared Cython runtime

2013-04-09 Thread Robert Bradshaw
On Tue, Apr 9, 2013 at 10:24 PM, Stefan Behnel wrote: > Nikita Nemkin, 10.04.2013 06:22: >> Robert Bradshaw, 09.04.2013 20:16: >>>>> Yep. We could even create stub .so files for the included ones that >>>>> did nothing but import the big one to avoid havin

Re: [Cython] Bug(?): chained assignments and tuple unpacking

2013-04-10 Thread Robert Bradshaw
Thanks for the detailed report. This does look like a bug. On Wed, Apr 10, 2013 at 1:36 PM, Alok Singhal wrote: > Hi, > > The following code (also attached as a .pyx file) fails in the current > Cython : > > cdef class test: > pass > > def main(): > cdef test a, b, c, d > (a, b) = (c,

Re: [Cython] bint and autodoc signatures

2013-04-16 Thread Robert Bradshaw
On Sun, Apr 14, 2013 at 2:49 AM, Stefan Behnel wrote: > Nikita Nemkin, 14.04.2013 11:33: >> Arguments, return values and properties of type 'bint' >> appear as 'int' in autogenerated signatures. >> >> This is very confusing for the end user and logically wrong. >> (For one thing, bint and int hand

Re: [Cython] [cython-users] Cython 0.19 beta 2 released

2013-04-16 Thread Robert Bradshaw
It'd be really good to get in two last-minute changes uncovered by Sage https://github.com/cython/cython/pull/214 https://github.com/cython/cython/pull/215 On Fri, Apr 12, 2013 at 5:16 AM, Stefan Behnel wrote: > Hi, > > I uploaded a second (and hopefully last) beta release for Cython 0.19. > Ple

Re: [Cython] Autodoc improvements (#216)

2013-04-22 Thread Robert Bradshaw
Jumping into this thread late, improvements (1) and (3) certainly seem beneficial. As far as documenting "attributes," I can't see much of a use, but the downsides seem are low enough (accidentally assigning a stray string to the previously declared attribute) and the implementation non-invasive en

Re: [Cython] libc.string msvc incompatibility

2013-04-23 Thread Robert Bradshaw
It would at the very least be worth putting a note on these functions, but I'm not sure how far we should go with aliasing the platform-specific alternatives. Certainly a .h file that you "cdef extern from" include with these defines would be the shortest path to getting things working on your side

Re: [Cython] Unit testing Cython extensions

2013-04-23 Thread Robert Bradshaw
There is nothing special about Cython here, if you have "foo.py" instead of "foo.so" you would be seeing exactly the same results. You need to either set PYTHONPATH or have foo be in the same package layout as your tests. On Tue, Apr 23, 2013 at 1:51 PM, Torsten Landschoff wrote: > Hi again, > >

Re: [Cython] A little bugtracker cleanup

2013-04-26 Thread Robert Bradshaw
Thanks. I closed some of these, for the rest I'd like to verify we at least have a regression test. On Fri, Apr 26, 2013 at 8:53 AM, Nikita Nemkin wrote: > Hi, > > While browsing Cython's bugtracker I've found a few > issues that should be closed as fixed: > > http://trac.cython.org/cython_trac/t

Re: [Cython] A little bugtracker cleanup

2013-04-28 Thread Robert Bradshaw
Thanks! On Fri, Apr 26, 2013 at 8:44 PM, Nikita Nemkin wrote: > On Sat, 27 Apr 2013 04:07:35 +0600, Robert Bradshaw > wrote: > >> Thanks. I closed some of these, for the rest I'd like to verify we at >> least have a regression test. > > > http://trac.cython

Re: [Cython] Generated C++ code incompatible with Clang

2013-04-29 Thread Robert Bradshaw
On Fri, Apr 12, 2013 at 8:04 AM, Hannes Röst wrote: > Dear mailing list > > In the process of developing a rather large Cython project where we wrap the > scientific OpenMS library (http://sourceforge.net/projects/open-ms/) using > Cython, we have come across an issue with the C++ code that is gen

Re: [Cython] Generated C++ code incompatible with Clang

2013-05-07 Thread Robert Bradshaw
ot have > the extra typedef. Is this a big problem? > > Maybe there are other people on the list that are more fluent in C++ and > could think of a way to do it? > > Greetings > > Hannes > > On 30 April 2013 07:48, Robert Bradshaw wrote: >> >> On Fri, Apr 12, 2

Re: [Cython] Cython 0.19.1 release candidate

2013-05-08 Thread Robert Bradshaw
It'd be nice to pull in https://github.com/cython/cython/commit/5574592e569e0cce5f1277b6f0c441d6d19122b5 as well. On Wed, May 8, 2013 at 7:25 AM, Stefan Behnel wrote: > Hi, > > here's a release candidate for 0.19.1. I accept feedback for the next two > days, then I'll send the final release out.

Re: [Cython] [cython-users] Re: Cython Typed Memoryviews versus Cython+Numpy Speed ups

2013-05-16 Thread Robert Bradshaw
On Fri, Apr 19, 2013 at 2:43 AM, Stefan Behnel wrote: > Robert Bradshaw, 17.04.2013 06:02: >> On Tue, Apr 16, 2013 at 6:46 PM, pythonOmetrist >>> Attached HTML seems mostly white, and not clear where to go from here. Nogil >>> seems to be one option. >> >&g

Re: [Cython] How should be C-clobal deletion handled?

2013-05-24 Thread Robert Bradshaw
On Thu, May 23, 2013 at 10:02 PM, Vitja Makarov wrote: > Hi! > > Recently I've found that the following code causes segmentation fault: > > cdef object f > del f > print f > > So the question is: how should that work? > > global objects are implicitly initialized to None and no CF and no cf > anal

Re: [Cython] How should be C-clobal deletion handled?

2013-05-25 Thread Robert Bradshaw
On May 25, 2013 10:37 AM, "Vitja Makarov" wrote: > > > > > 2013/5/25 Stefan Behnel >> >> Am 25.05.2013 08:34, schrieb Robert Bradshaw: >> > On Thu, May 23, 2013 at 10:02 PM, Vitja Makarov wrote: >> >> Recently I've found that the fo

Re: [Cython] Old style dependency tracking

2013-05-27 Thread Robert Bradshaw
Makes sense to me. https://github.com/robertwb/cython/commit/67c183d5f62dcba600ceaa7a240157a3c2e5d5c2 On Sun, May 26, 2013 at 10:55 AM, Nikita Nemkin wrote: > Hi, > > I wonder if it's time to to remove old dependency tracking code? > I mean this: http://trac.cython.org/cython_trac/ticket/379, > C

Re: [Cython] Exception check optimization

2013-05-29 Thread Robert Bradshaw
On Sun, May 26, 2013 at 10:04 AM, Nikita Nemkin wrote: > Hi, > > I wonder why is __pyx_filename (in exception check blocks) > tracked dynamically? AFAIK it's impossible to split function > body between multiple files (include only works at the top level), > which makes filename a compile time cons

Re: [Cython] C data type and a C function() sharing the same name

2013-06-01 Thread Robert Bradshaw
On Sat, Jun 1, 2013 at 7:35 AM, Marin Atanasov Nikolov wrote: > Thanks, Nikita! > > I've been looking at the Cython documentation, but was not able to find it > previously, thanks! > > I'm still waiting for my previous posts to show up in the cython-users@ > mailing list (although I am subscribed

Re: [Cython] Conditional cast and builtin types

2013-06-15 Thread Robert Bradshaw
On Fri, Jun 7, 2013 at 5:58 AM, Stefan Behnel wrote: > Nikita Nemkin, 07.06.2013 13:14: >> I have just discovered that the following operations do not perform >> any type checking ("?" is ignored): >> >> obj, obj, obj, obj, obj. >> >> Can someone please confirm this as a bug? > > I never tried it,

Re: [Cython] patch for #655

2013-06-25 Thread Robert Bradshaw
We prefer changes as pull requests to https://github.com/cython/cython? One first comment, I think it's a lot to reserve three flags for this. Perhaps "-M [filename] would be sufficient, using the convention that - is stdout. If necessary, we could have a special syntax for the -D option. I'm sti

Re: [Cython] patch for #655

2013-06-27 Thread Robert Bradshaw
On Thu, Jun 27, 2013 at 1:26 AM, Felix Salfelder wrote: > Hi Stefan. > > On Thu, Jun 27, 2013 at 08:58:28AM +0200, Stefan Behnel wrote: >> Make doesn't know that either. Cython at least knows which ones are used >> directly. Handling transitive dependencies would require parsing header >> files. I

Re: [Cython] patch for #655

2013-06-27 Thread Robert Bradshaw
On Thu, Jun 27, 2013 at 10:25 AM, Felix Salfelder wrote: > On Thu, Jun 27, 2013 at 09:23:21AM -0700, Robert Bradshaw wrote: >> > explicit dependency tracking would imply "manual". which is painful and >> > error-prone. without running gcc -M (with all flags) you can

Re: [Cython] patch for #655

2013-06-27 Thread Robert Bradshaw
On Thu, Jun 27, 2013 at 12:18 PM, Felix Salfelder wrote: > Hi Robert. > > On Thu, Jun 27, 2013 at 11:05:48AM -0700, Robert Bradshaw wrote: >> And you're planning on calling cython manually, cutting distutils out >> of the loop completely? > > If someone tells m

<    1   2   3   4   5   6   7   8   >