[Numpy-discussion] `out` argument to ufuncs

2008-09-04 Thread Stéfan van der Walt
Hey all, Gael just asked me why `add`, `subtract` etc. didn't have out arguments like `cos` and `sin`. I couldn't give him a good answer. Could we come to an agreement to add a uniform interface to ufuncs for 1.3? Either all or none of them should support the out argument. I see a couple of

Re: [Numpy-discussion] `out` argument to ufuncs

2008-09-04 Thread Robert Kern
On Thu, Sep 4, 2008 at 02:03, Stéfan van der Walt [EMAIL PROTECTED] wrote: Hey all, Gael just asked me why `add`, `subtract` etc. didn't have out arguments like `cos` and `sin`. I couldn't give him a good answer. Could we come to an agreement to add a uniform interface to ufuncs for 1.3?

[Numpy-discussion] numpy 1.3: cleaning the math configuration, toward a warning free build

2008-09-04 Thread David Cournapeau
Hi, For numpy 1.3, there are several things I would like to work on, which I have already hinted previously. The two big things are: - cleaning the math configuration - making numpy buildable warning-free with a good set a warning flags. For the warning-free build, I have

Re: [Numpy-discussion] Updated Numpy reference guide

2008-09-04 Thread Ondrej Certik
Hi Pauli! On Sun, Aug 31, 2008 at 8:21 PM, Pauli Virtanen [EMAIL PROTECTED] wrote: Hi all, I finished the first iteration of incorporating material from Travis Oliphant's Guide to Numpy to the Sphinxy reference guide we were constructing in the Doc marathon. Result is here: (the PDF is a

Re: [Numpy-discussion] `out` argument to ufuncs

2008-09-04 Thread Stéfan van der Walt
2008/9/4 Robert Kern [EMAIL PROTECTED]: I am confused. add() and subtract() *do* take an out argument. So it does. We both tried a keyword-style argument, which I think is a reasonable expectation? Cheers Stéfan ___ Numpy-discussion mailing list

Re: [Numpy-discussion] `out` argument to ufuncs

2008-09-04 Thread Robert Kern
On Thu, Sep 4, 2008 at 05:01, Stéfan van der Walt [EMAIL PROTECTED] wrote: 2008/9/4 Robert Kern [EMAIL PROTECTED]: I am confused. add() and subtract() *do* take an out argument. So it does. We both tried a keyword-style argument, which I think is a reasonable expectation? It would certainly

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-04 Thread Hanni Ali
Hi, Is there a way I can set numpy to use dtype='float64' throughout all my code or force it to use the biggest datatype without adding the dtype='float64' to every call to mean, stdev etc.. 2008/9/3 Sebastian Stephan Berg [EMAIL PROTECTED] Hi, just guessing here. But numarray seems to

Re: [Numpy-discussion] Floating Point Difference between numpy and numarray

2008-09-04 Thread David Cournapeau
Hanni Ali wrote: Hi, Is there a way I can set numpy to use dtype='float64' throughout all my code or force it to use the biggest datatype without adding the dtype='float64' to every call to mean, stdev etc.. Since it is the default type for the functions you mention, you can just remove any

Re: [Numpy-discussion] `out` argument to ufuncs

2008-09-04 Thread Gael Varoquaux
On Thu, Sep 04, 2008 at 05:24:53AM -0500, Robert Kern wrote: On Thu, Sep 4, 2008 at 05:01, Stéfan van der Walt [EMAIL PROTECTED] wrote: 2008/9/4 Robert Kern [EMAIL PROTECTED]: I am confused. add() and subtract() *do* take an out argument. Hum, good! So it does. We both tried a

Re: [Numpy-discussion] numpy 1.3: cleaning the math configuration, toward a warning free build

2008-09-04 Thread Travis E. Oliphant
Should I write a nep for that too ? Or a patch is enough ? I think a patch with a useful explanation of the patch in the ticket is sufficient. -Travis ___ Numpy-discussion mailing list Numpy-discussion@scipy.org

[Numpy-discussion] numpy build on windows

2008-09-04 Thread Miroslav Sabljic
Hy people! I'm quite a newbie regarding numpy so please excuse if I'm asking stupid questions. I need to build Python and couple of his site-packages on Windows using Visual studio 2008. I've built Python 2.5.1 and now it's turn to build numpy and I'm quite stuck because numpy build process is a

Re: [Numpy-discussion] numpy build on windows

2008-09-04 Thread David Cournapeau
Miroslav Sabljic wrote: Hy people! I'm quite a newbie regarding numpy so please excuse if I'm asking stupid questions. No stupid question. Stupid answer may follow, though... I need to build Python and couple of his site-packages on Windows using Visual studio 2008. I've built Python

Re: [Numpy-discussion] numpy build on windows

2008-09-04 Thread Miroslav Sabljić
David Cournapeau wrote: Ok, you are building on windows, with a custom python, on windows 64 bits, with MKL... That's a lot at the same time. I'm building it with custom Python (built with VS 2008) on Win32. It is a lot for me but I just have to do it and learn as much as posible during the

Re: [Numpy-discussion] numpy build on windows

2008-09-04 Thread David Cournapeau
On Fri, Sep 5, 2008 at 2:30 AM, Miroslav Sabljić [EMAIL PROTECTED] wrote: David Cournapeau wrote: Ok, you are building on windows, with a custom python, on windows 64 bits, with MKL... That's a lot at the same time. I'm building it with custom Python (built with VS 2008) on Win32. It is a

[Numpy-discussion] BUG in numpy.loadtxt?

2008-09-04 Thread Ryan May
Stefan (or anyone else who can comment), It appears that the usecols argument to loadtxt no longer accepts numpy arrays: from StringIO import StringIO text = StringIO('1 2 3\n4 5 6\n') data = np.loadtxt(text, usecols=np.arange(1,3)) ValueErrorTraceback (most

Re: [Numpy-discussion] `out` argument to ufuncs

2008-09-04 Thread Pauli Virtanen
Thu, 04 Sep 2008 15:32:18 +0200, Gael Varoquaux wrote: [clip] Cool. Either that, or fix'n the docs. I had a look at the docstring and it wasn't hinted by the docstring. THe docstring editor is here for fixing these details, but I think I'll simply wait for you to add the keyword argument :).

Re: [Numpy-discussion] numpy build on windows

2008-09-04 Thread Miroslav Sabljić
David Cournapeau wrote: From scipy.org ? If you understood you have to use the MLK, then we have to improve the documentation (the installation pages are a mess ATM). It is certainly no mandatory. Yeah, from scipy.org. Do you have to use VS 2008 ? Building python on windows is not easy

[Numpy-discussion] test results of 1.2.0rc1

2008-09-04 Thread Andrew Straw
Hi, with numpy 1.2.0rc1 running 'python -c import numpy; numpy.test()' on my Ubuntu Hardy amd64 machine results in 1721 tests being run and 1 skipped. So far, so good. However, if I run numpy.test(10,10,all=True), I get 1846 tests with: the message FAILED (SKIP=1, errors=8, failures=68)

Re: [Numpy-discussion] test results of 1.2.0rc1

2008-09-04 Thread Pauli Virtanen
Thu, 04 Sep 2008 11:51:14 -0700, Andrew Straw wrote: Hi, with numpy 1.2.0rc1 running 'python -c import numpy; numpy.test()' on my Ubuntu Hardy amd64 machine results in 1721 tests being run and 1 skipped. So far, so good. However, if I run numpy.test(10,10,all=True), I get 1846 tests with:

Re: [Numpy-discussion] BUG in numpy.loadtxt?

2008-09-04 Thread Travis E. Oliphant
Ryan May wrote: Stefan (or anyone else who can comment), It appears that the usecols argument to loadtxt no longer accepts numpy arrays: Could you enter a ticket so we don't lose track of this. I don't remember anything being intentional. -Travis

Re: [Numpy-discussion] test results of 1.2.0rc1

2008-09-04 Thread Pauli Virtanen
Thu, 04 Sep 2008 19:07:24 +, Pauli Virtanen wrote: [clip] I'd say that the settings are unintended in the sense that they run all examples in all docstrings. There are quite a few of these, and some indeed plot some graphs. Ideally, all examples should run, but this is not assured at the

Re: [Numpy-discussion] `out` argument to ufuncs

2008-09-04 Thread Robert Kern
On Thu, Sep 4, 2008 at 08:32, Gael Varoquaux [EMAIL PROTECTED] wrote: On Thu, Sep 04, 2008 at 05:24:53AM -0500, Robert Kern wrote: On Thu, Sep 4, 2008 at 05:01, Stéfan van der Walt [EMAIL PROTECTED] wrote: 2008/9/4 Robert Kern [EMAIL PROTECTED]: I am confused. add() and subtract() *do* take

[Numpy-discussion] Getting a numpy array from a ctype pointer

2008-09-04 Thread Paulo J. S. Silva
Hello, I am writing some code interfacing C and Python using ctypes. In a callback function (in Python) I get in a parameter x which is c_double pointer and a parameter n which is c_int representing the length of the array. How can I transform this information into a numpy array? Paulo

Re: [Numpy-discussion] Getting a numpy array from a ctype pointer

2008-09-04 Thread Travis E. Oliphant
Paulo J. S. Silva wrote: Hello, I am writing some code interfacing C and Python using ctypes. In a callback function (in Python) I get in a parameter x which is c_double pointer and a parameter n which is c_int representing the length of the array. How can I transform this information

[Numpy-discussion] How to import data where the decimal separator is a comma ?

2008-09-04 Thread oc-spam66
Hello, I have data files where the decimal separator is a comma. Can I import this data with numpy.loadtxt ? Notes : - I tried to set the locale LC_NUMERIC=fr_FR.UTF-8 but it didn't change anything. - Python 2.5.2, Numpy 1.1.0 Have a nice day, O.C. Créez votre adresse électronique

Re: [Numpy-discussion] BUG in numpy.loadtxt?

2008-09-04 Thread Ryan May
Travis E. Oliphant wrote: Ryan May wrote: Stefan (or anyone else who can comment), It appears that the usecols argument to loadtxt no longer accepts numpy arrays: Could you enter a ticket so we don't lose track of this. I don't remember anything being intentional. Done: #905

Re: [Numpy-discussion] Getting a numpy array from a ctype pointer

2008-09-04 Thread Paulo J. S. Silva
Em Qui, 2008-09-04 às 15:01 -0500, Travis E. Oliphant escreveu: Paulo J. S. Silva wrote: Something like this may work: from numpy import ctypeslib r = ctypeslib.as_array(x._type_ * n) Unfortunately, it didn't work. If that doesn't work, then you can create an array from an

Re: [Numpy-discussion] Getting a numpy array from a ctype pointer

2008-09-04 Thread Paulo J. S. Silva
After some trial and erros, I found a solution, described below. Is this the best one? Looks a little convoluted to me (C represents ctypes module and np numpy): Array = n*C.c_double x = Array.from_address(C.addressof(x.contents)) x = np.ctypeslib.as_array(x) Thanks,

Re: [Numpy-discussion] Getting a numpy array from a ctype pointer

2008-09-04 Thread Travis E. Oliphant
Paulo J. S. Silva wrote: After some trial and erros, I found a solution, described below. Is this the best one? Looks a little convoluted to me (C represents ctypes module and np numpy): Array = n*C.c_double x = Array.from_address(C.addressof(x.contents)) x =

[Numpy-discussion] isnan and co: cleaning up

2008-09-04 Thread David Cournapeau
Hi, While working on my branch to clean the math configuration, I noticed that the code for isnan and co became quite convoluted. autoconf info file has a mention of it, and suggests the following for portability (section 5.5.1 of autoconf): The C99 standard says that `isinf' and