Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Stéfan van der Walt
2009/1/9 Robert Kern : > On Fri, Jan 9, 2009 at 01:19, Stéfan van der Walt wrote: > >> I think we should urge developers to run the test suite this way, so >> that we remain aware of failures, even if they are decorated. > > I don't think we should use unit tests as a bug tracker. We have Trac. >

Re: [Numpy-discussion] Replacement for numpy.distutils.config.try_run

2009-01-08 Thread David Cournapeau
Stéfan van der Walt wrote: > Hi, > > In distutils/config.py line 32 I see: > > "Usage of try_run is deprecated: please do not \n" \ > "use it anymore, and avoid configuration checks \n" \ > "involving running executable on the target

[Numpy-discussion] Replacement for numpy.distutils.config.try_run

2009-01-08 Thread Stéfan van der Walt
Hi, In distutils/config.py line 32 I see: "Usage of try_run is deprecated: please do not \n" \ "use it anymore, and avoid configuration checks \n" \ "involving running executable on the target machine.\n" \ What is the recommended

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread David Cournapeau
Stéfan van der Walt wrote: > 2009/1/9 David Cournapeau : > >> On Fri, Jan 9, 2009 at 5:36 AM, Christopher Hanley wrote: >> >>> I do not expect the trunk to always work. I even expect it to have >>> bugs. However, I do not expect there to be test failures for known >>> reasons that result

Re: [Numpy-discussion] replace array values efficiently

2009-01-08 Thread Robert Kern
On Fri, Jan 9, 2009 at 01:19, Prashant Saxena wrote: > Hi, > > I am new to numpy and getting my hands on slowly. > > How do you replace integers from strings in an integer array. (1D) > > For example: > > array = {1,1,1,2,3,3,4} > > replace 1 with "apple" > replace 2 with "cheery" > replace 3 with

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Robert Kern
On Fri, Jan 9, 2009 at 01:19, Stéfan van der Walt wrote: > I think we should urge developers to run the test suite this way, so > that we remain aware of failures, even if they are decorated. I don't think we should use unit tests as a bug tracker. We have Trac. Each known-failing test (or group

[Numpy-discussion] replace array values efficiently

2009-01-08 Thread Prashant Saxena
Hi, I am new to numpy and getting my hands on slowly. How do you replace integers from strings in an integer array. (1D) For example: array = {1,1,1,2,3,3,4} replace 1 with "apple" replace 2 with "cheery" replace 3 with "mango" replace 4 with "banana" I know the general solution, but I am lo

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Stéfan van der Walt
2009/1/9 David Cournapeau : > On Fri, Jan 9, 2009 at 5:36 AM, Christopher Hanley wrote: >> >> I do not expect the trunk to always work. I even expect it to have >> bugs. However, I do not expect there to be test failures for known >> reasons that result in wasSuccessful() returning false. This

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread David Cournapeau
On Fri, Jan 9, 2009 at 2:21 PM, David Cournapeau wrote: > On Fri, Jan 9, 2009 at 5:36 AM, Christopher Hanley wrote: >> >> I do not expect the trunk to always work. I even expect it to have >> bugs. However, I do not expect there to be test failures for known >> reasons that result in wasSuccess

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread David Cournapeau
On Fri, Jan 9, 2009 at 5:36 AM, Christopher Hanley wrote: > > I do not expect the trunk to always work. I even expect it to have > bugs. However, I do not expect there to be test failures for known > reasons that result in wasSuccessful() returning false. This is a bad > programming practice.

Re: [Numpy-discussion] checking array for NaN values.

2009-01-08 Thread josef . pktd
On Thu, Jan 8, 2009 at 9:15 PM, Alexandra Geddes wrote: > Is there an easy way to check an array for NaN values? 'all(array)' regards > NaN as true (because it's not 0). I've tried all(array != nan) which didn't > work either. When i call locations which i know are NaN, it returns -1.#IND. >

[Numpy-discussion] checking array for NaN values.

2009-01-08 Thread Alexandra Geddes
Is there an easy way to check an array for NaN values? 'all(array)' regards NaN as true (because it's not 0). I've tried all(array != nan) which didn't work either. When i call locations which i know are NaN, it returns -1.#IND. But if i try to call all(array != -1.#IND), python interprets t

Re: [Numpy-discussion] Accumulate values that are below threshold

2009-01-08 Thread Bevan Jenkins
Stéfan van der Walt sun.ac.za> writes: > > Hi Bevan > > Since the number of output elements are unknown, I don't think you can > implement this efficiently using arrays. If your dataset isn't too > large, a for-loop should do the trick. Otherwise, you may have to run > your code through Cytho

Re: [Numpy-discussion] help with typemapping a C function to use numpy arrays

2009-01-08 Thread Rich E
I am using %includ "sms.h", which is what is wrapping all my functions. Without doing this, I have to hand-wrap every function in the header file! Is there a way to exclude certain definitions from my c header file when using %include, so that I can hand wrap them instead? On Thu, Jan 8, 2009 at

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Christopher Hanley
David Cournapeau wrote: > On Fri, Jan 9, 2009 at 5:11 AM, Christopher Hanley wrote: >> David Cournapeau wrote: >>> On Fri, Jan 9, 2009 at 4:29 AM, Christopher Hanley >>> wrote: David Cournapeau wrote: > On Fri, Jan 9, 2009 at 1:37 AM, Christopher Hanley > wrote: >> Hi, >>

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Robert Kern
On Thu, Jan 8, 2009 at 11:37, Christopher Hanley wrote: > Hi, > > I've committed the following change to test_print.py to fix one of the > tests. > > Index: test_print.py > === > --- test_print.py (revision 6302) > +++ test_prin

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Robert Kern
On Thu, Jan 8, 2009 at 15:26, David Cournapeau wrote: > Personally, I don't like knownfailure much anyway: I feel like it is > too easy to tag one test known failure, and then nobody cares about it > anymore. Those formatting problems were already problems before - the > tests only show the probl

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread David Cournapeau
On Fri, Jan 9, 2009 at 5:11 AM, Christopher Hanley wrote: > David Cournapeau wrote: >> On Fri, Jan 9, 2009 at 4:29 AM, Christopher Hanley wrote: >>> David Cournapeau wrote: On Fri, Jan 9, 2009 at 1:37 AM, Christopher Hanley wrote: > Hi, > > I've committed the following cha

Re: [Numpy-discussion] my cython is slow

2009-01-08 Thread Dag Sverre Seljebotn
Some of the problems you encounter could probably be remedied by better support in Cython for some situations. I've filed two feature request tickets for myself, but I have no idea when or if I'll get around to them. http://trac.cython.org/cython_trac/ticket/177 http://trac.cython.org/cython_tra

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Christopher Hanley
David Cournapeau wrote: > On Fri, Jan 9, 2009 at 4:29 AM, Christopher Hanley wrote: >> David Cournapeau wrote: >>> On Fri, Jan 9, 2009 at 1:37 AM, Christopher Hanley >>> wrote: Hi, I've committed the following change to test_print.py to fix one of the tests. >>> Hi Chris

Re: [Numpy-discussion] my cython is slow

2009-01-08 Thread John Hunter
On Thu, Jan 8, 2009 at 12:34 PM, Eric Firing wrote: > John Hunter wrote: >> On Wed, Jan 7, 2009 at 5:37 PM, Eric Firing wrote: >> >>> A couple small changes speed it up quite a bit: >>> >>> efir...@manini:~/temp/nnbf$ python test_nnbf.py >>> loading data... this could take a while >>> testing n

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread David Cournapeau
On Fri, Jan 9, 2009 at 4:29 AM, Christopher Hanley wrote: > David Cournapeau wrote: >> On Fri, Jan 9, 2009 at 1:37 AM, Christopher Hanley wrote: >>> Hi, >>> >>> I've committed the following change to test_print.py to fix one of the >>> tests. >>> >> >> Hi Christopher, >> >> Please do not modify t

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread Christopher Hanley
David Cournapeau wrote: > On Fri, Jan 9, 2009 at 1:37 AM, Christopher Hanley wrote: >> Hi, >> >> I've committed the following change to test_print.py to fix one of the >> tests. >> > > Hi Christopher, > > Please do not modify those tests - they are supposed to fail, > > David >

Re: [Numpy-discussion] change made to test_print.py

2009-01-08 Thread David Cournapeau
On Fri, Jan 9, 2009 at 1:37 AM, Christopher Hanley wrote: > Hi, > > I've committed the following change to test_print.py to fix one of the > tests. > Hi Christopher, Please do not modify those tests - they are supposed to fail, David ___ Numpy-discuss

Re: [Numpy-discussion] my cython is slow

2009-01-08 Thread Eric Firing
John Hunter wrote: > On Wed, Jan 7, 2009 at 5:37 PM, Eric Firing wrote: > >> A couple small changes speed it up quite a bit: >> >> efir...@manini:~/temp/nnbf$ python test_nnbf.py >> loading data... this could take a while >> testing nnbf... >>10 trials: mean=0.0150, min=0.0100 >> testing nu

Re: [Numpy-discussion] my cython is slow

2009-01-08 Thread John Hunter
On Wed, Jan 7, 2009 at 5:37 PM, Eric Firing wrote: > A couple small changes speed it up quite a bit: > > efir...@manini:~/temp/nnbf$ python test_nnbf.py > loading data... this could take a while > testing nnbf... >10 trials: mean=0.0150, min=0.0100 > testing numpy... >10 trials: mean=0.

[Numpy-discussion] change made to test_print.py

2009-01-08 Thread Christopher Hanley
Hi, I've committed the following change to test_print.py to fix one of the tests. Index: test_print.py === --- test_print.py (revision 6302) +++ test_print.py (working copy) @@ -154,7 +154,7 @@ else:

Re: [Numpy-discussion] ANN: numpy.i - added managed deallocation to ARGOUTVIEW_ARRAY1 (ARGOUTVIEWM_ARRAY1)

2009-01-08 Thread Egor Zindy
Hello list, I've moved my wiki to the scipy cookbook: http://www.scipy.org/Cookbook/SWIG_Memory_Deallocation For the time being, the listed example files are still stored on the google code SVN, but these could easily be moved if necessary. I've also just finished adding an ARGOUTVIEWM_ARRAY2 ex