Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-14 Thread Antony Lee
I wonder whether numpy is using the "old" iteration protocol (repeatedly calling x[i] for increasing i until StopIteration is reached?) A quick timing shows that it is indeed slower. ... actually it's not even clear to me what qualifies as a sequence for `np.array`: class C: def

Re: [Numpy-discussion] Numexpr-3.0 proposal

2016-02-14 Thread Ralf Gommers
On Sun, Feb 14, 2016 at 11:19 PM, Robert McLeod wrote: > > 4.) I took a stab at converting from distutils to setuputils but this > seems challenging with numpy as a dependency. I wonder if anyone has tried > monkey-patching so that setup.py build_ext uses distutils and then

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-14 Thread Ralf Gommers
On Sun, Feb 14, 2016 at 10:36 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Sun, Feb 14, 2016 at 7:36 AM, Ralf Gommers > wrote: > >> >> >> On Sun, Feb 14, 2016 at 9:21 AM, Antony Lee >> wrote: >> >>> re: no reason why... >>>

[Numpy-discussion] Numexpr-3.0 proposal

2016-02-14 Thread Robert McLeod
Hello everyone, I've done some work on making a new version of Numexpr that would fix some of the limitations of the original virtual machine with regards to data types and operation/function count. Basically I re-wrote the Python and C sides to use 4-byte words, instead of null-terminated

Re: [Numpy-discussion] Modulus (remainder) function corner cases

2016-02-14 Thread Charles R Harris
On Sun, Feb 14, 2016 at 12:54 PM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Sun, Feb 14, 2016 at 12:35 PM, Nils Becker > wrote: > >> 2016-02-13 17:42 GMT+01:00 Charles R Harris : >> >>> The Fortran modulo function, which is

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-14 Thread Antony Lee
I was thinking (1) (special-case range()); however (2) may be more generally applicable and useful. Antony 2016-02-14 6:36 GMT-08:00 Ralf Gommers : > > > On Sun, Feb 14, 2016 at 9:21 AM, Antony Lee > wrote: > >> re: no reason why... >> This has

Re: [Numpy-discussion] Modulus (remainder) function corner cases

2016-02-14 Thread Charles R Harris
On Sun, Feb 14, 2016 at 1:11 PM, Charles R Harris wrote: > > > On Sun, Feb 14, 2016 at 12:54 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Sun, Feb 14, 2016 at 12:35 PM, Nils Becker >> wrote: >> >>> 2016-02-13 17:42

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-14 Thread Charles R Harris
On Sun, Feb 14, 2016 at 7:36 AM, Ralf Gommers wrote: > > > On Sun, Feb 14, 2016 at 9:21 AM, Antony Lee > wrote: > >> re: no reason why... >> This has nothing to do with Python2/Python3 (I personally stopped using >> Python2 at least 3 years ago.)

Re: [Numpy-discussion] Modulus (remainder) function corner cases

2016-02-14 Thread Nils Becker
2016-02-13 17:42 GMT+01:00 Charles R Harris : > The Fortran modulo function, which is the same basic function as in my >> branch, does not specify any bounds on the result for floating numbers, but >> gives only the formula, modulus(a, b) = a - b*floor(a/b), which has

Re: [Numpy-discussion] Modulus (remainder) function corner cases

2016-02-14 Thread Charles R Harris
On Sun, Feb 14, 2016 at 12:35 PM, Nils Becker wrote: > 2016-02-13 17:42 GMT+01:00 Charles R Harris : > >> The Fortran modulo function, which is the same basic function as in my >>> branch, does not specify any bounds on the result for floating

Re: [Numpy-discussion] ANN: numpydoc 0.6.0 released

2016-02-14 Thread Ralf Gommers
On Sat, Feb 13, 2016 at 10:38 PM, wrote: > > > On Sat, Feb 13, 2016 at 10:03 AM, Ralf Gommers > wrote: > >> Hi all, >> >> I'm pleased to announce the release of numpydoc 0.6.0. The main new >> feature is support for the Yields section in numpy-style

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-14 Thread josef.pktd
On Sun, Feb 14, 2016 at 3:21 AM, Antony Lee wrote: > re: no reason why... > This has nothing to do with Python2/Python3 (I personally stopped using > Python2 at least 3 years ago.) Let me put it this way instead: if > Python3's "range" (or Python2's "xrange") was not a

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-14 Thread Ralf Gommers
On Sun, Feb 14, 2016 at 9:21 AM, Antony Lee wrote: > re: no reason why... > This has nothing to do with Python2/Python3 (I personally stopped using > Python2 at least 3 years ago.) Let me put it this way instead: if > Python3's "range" (or Python2's "xrange") was not a

Re: [Numpy-discussion] Suggestion: special-case np.array(range(...)) to be faster

2016-02-14 Thread Antony Lee
re: no reason why... This has nothing to do with Python2/Python3 (I personally stopped using Python2 at least 3 years ago.) Let me put it this way instead: if Python3's "range" (or Python2's "xrange") was not a builtin type but a type provided by numpy, I don't think it would be controversial at