[Numpy-discussion] Review of issue 825

2008-06-25 Thread Neil Muller
Could someone review the patch at http://scipy.org/scipy/numpy/ticket/825, please? The issue prevents the test suite running successfully on Sparc, so I'd like to see it fixed. -- Neil Muller [EMAIL PROTECTED] ___ Numpy-discussion mailing list

[Numpy-discussion] Infinity as nan as real part

2008-06-25 Thread Stéfan van der Walt
Hi all, Why can't a person construct a complex number with an infinite complex part and a zero real part? 1 + 1j*np.inf == (nan + infj) # because np.inf * 1j == (nan + infj) There is a workaround: z = np.array([0], dtype=complex) z.imag = np.inf but that's not very pleasant. Is this a bug,

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 12:44 AM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: Could someone review the patch at http://scipy.org/scipy/numpy/ticket/825, please? The issue prevents the test suite running successfully on Sparc, so I'd like to see it fixed. Looks like the copybuffer

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 8:12 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 12:44 AM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: Could someone review the patch at http://scipy.org/scipy/numpy/ticket/825, please? The issue prevents the test suite

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 8:17 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 8:12 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 12:44 AM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: Could someone review the patch at

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Neil Muller
On Wed, Jun 25, 2008 at 5:14 PM, Charles R Harris [EMAIL PROTECTED] wrote: OK, the problem in the UNICODE_{get,set}item routines is converting between ucs4 and the encoding python is using, which may be ucs2. But there is something strange if sparc is using ucs4 (Py_UNICODE_WIDE) and the

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-25 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 3:03 PM, Alan McIntyre [EMAIL PROTECTED] wrote: On Mon, Jun 23, 2008 at 2:37 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: Can you make the convention chosen for the examples (currently only in the doc wiki, not yet in SVN) to work: assuming import numpy as np in

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 10:49 AM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 5:14 PM, Charles R Harris [EMAIL PROTECTED] wrote: OK, the problem in the UNICODE_{get,set}item routines is converting between ucs4 and the encoding python is using, which may be

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 11:53 AM, Charles R Harris [EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 10:49 AM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 5:14 PM, Charles R Harris [EMAIL PROTECTED] wrote: OK, the problem in the UNICODE_{get,set}item

Re: [Numpy-discussion] Infinity as nan as real part

2008-06-25 Thread Robert Kern
On Wed, Jun 25, 2008 at 07:42, Stéfan van der Walt [EMAIL PROTECTED] wrote: Hi all, Why can't a person construct a complex number with an infinite complex part and a zero real part? 1 + 1j*np.inf == (nan + infj) # because np.inf * 1j == (nan + infj) In [1]: from numpy import * In [3]: 1j

Re: [Numpy-discussion] Infinity as nan as real part

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 6:42 AM, Stéfan van der Walt [EMAIL PROTECTED] wrote: Hi all, Why can't a person construct a complex number with an infinite complex part and a zero real part? 1 + 1j*np.inf == (nan + infj) # because np.inf * 1j == (nan + infj) There is a workaround: z =

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Neil Muller
On Wed, Jun 25, 2008 at 7:53 PM, Charles R Harris [EMAIL PROTECTED] wrote: But I wonder if this case isn't supposed to be caught by this fragment: if (!PyArray_ISBEHAVED(ap)) { buffer = _pya_malloc(mysize 2); if (buffer == NULL) return PyErr_NoMemory();

Re: [Numpy-discussion] Infinity as nan as real part

2008-06-25 Thread Stéfan van der Walt
2008/6/25 Robert Kern [EMAIL PROTECTED]: In [1]: from numpy import * In [3]: 1j == (0+1j) Out[3]: True In [4]: 0*inf Out[4]: nan Fair enough. How about z = np.complex(0, np.inf) z**2 == (nannanj) Shouldn't that be -inf? Regards Stéfan ___

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Neil Muller
On Wed, Jun 25, 2008 at 8:46 PM, Charles R Harris [EMAIL PROTECTED] wrote: Looks to me like the NPY_ALIGNED flag is incorrectly set. Can you check this by printing the results of PyArray_CHKFLAGS(ap, NPY_ALIGNED) For the test listed in the ticket, the array isn't flagged as aligned -

Re: [Numpy-discussion] Infinity as nan as real part

2008-06-25 Thread Robert Kern
On Wed, Jun 25, 2008 at 15:16, Stéfan van der Walt [EMAIL PROTECTED] wrote: 2008/6/25 Robert Kern [EMAIL PROTECTED]: In [1]: from numpy import * In [3]: 1j == (0+1j) Out[3]: True In [4]: 0*inf Out[4]: nan Fair enough. How about z = np.complex(0, np.inf) z**2 == (nannanj) Shouldn't

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 10:49 AM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 5:14 PM, Charles R Harris [EMAIL PROTECTED] wrote: OK, the problem in the UNICODE_{get,set}item routines is converting between ucs4 and the encoding python is using, which may be

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 2:04 PM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 7:53 PM, Charles R Harris [EMAIL PROTECTED] wrote: But I wonder if this case isn't supposed to be caught by this fragment: if (!PyArray_ISBEHAVED(ap)) { buffer =

Re: [Numpy-discussion] Code samples in docstrings mistaken as doctests

2008-06-25 Thread Alan McIntyre
On Mon, Jun 23, 2008 at 2:37 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: Can you make the convention chosen for the examples (currently only in the doc wiki, not yet in SVN) to work: assuming import numpy as np in examples? Are there any other implicit imports that we will need? How about for

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
Hi Neil, On Wed, Jun 25, 2008 at 2:26 PM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 8:46 PM, Charles R Harris [EMAIL PROTECTED] wrote: Looks to me like the NPY_ALIGNED flag is incorrectly set. Can you check this by printing the results of

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 8:42 PM, Charles R Harris [EMAIL PROTECTED] wrote: Hi Neil, On Wed, Jun 25, 2008 at 2:26 PM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 8:46 PM, Charles R Harris [EMAIL PROTECTED] wrote: Looks to me like the NPY_ALIGNED

Re: [Numpy-discussion] Review of issue 825

2008-06-25 Thread Charles R Harris
On Wed, Jun 25, 2008 at 9:13 PM, Charles R Harris [EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 8:42 PM, Charles R Harris [EMAIL PROTECTED] wrote: Hi Neil, On Wed, Jun 25, 2008 at 2:26 PM, Neil Muller [EMAIL PROTECTED][EMAIL PROTECTED] wrote: On Wed, Jun 25, 2008 at 8:46 PM,