[Numpy-discussion] arrays : c aligmen to fortran and back

2008-08-03 Thread Thomas Hrabe
Hi all, I need to convert a 3d array from c alingment to fortran and was wandering for the simplest code available. Its all about python and an interfaced C++ program, which, however, processes fortran aligned arrays. Is there a simple code from converting an array arr = numpy.array((30,20,10)

Re: [Numpy-discussion] Renaming MaskedArray._basedict

2008-08-03 Thread Pierre GM
Eric, Good point. Off we go with the warning then. > > The attribute name, _basedict, indicates that it is a private attribute, > so I don't see why a deprecation warning is needed at all. Anyone using > private attributes should also be reading release notes. I don't like > the idea of a warning

Re: [Numpy-discussion] Bilteral filter

2008-08-03 Thread Nadav Horesh
I'll post the code in this mailing list, and hope it would find a good home. Nadav. -הודעה מקורית- מאת: [EMAIL PROTECTED] בשם David Bolme נשלח: א 03-אוגוסט-08 18:19 אל: Discussion of Numerical Python נושא: Re: [Numpy-discussion] Bilteral filter I am building up a python Computer Visi

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread David Cournapeau
On Sun, 2008-08-03 at 19:32 -0500, Charles R Harris wrote: > > > > There is self and args, filter them out. If the arguments have other > names, rename them. That's much more error prone. You would need a list of such arguments, and more importantly, it means you cannot enable warnin

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread David Cournapeau
On Mon, 2008-08-04 at 01:50 +0200, Stéfan van der Walt wrote: > > Just to be clear: I meant that I agree with you that we should see > NumPy related warnings that aren't smothered in bogus messages. Is > there no way to do this without compiler-specific hacks? Yes, there is, but it is more error

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread Charles R Harris
On Sun, Aug 3, 2008 at 6:39 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > On Mon, Aug 4, 2008 at 8:31 AM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > But how many methods do arrays and types have? As many as 1500? > > With autogenerated code, it is not difficult to imagine so many wa

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread Stéfan van der Walt
2008/8/4 David Cournapeau <[EMAIL PROTECTED]>: > On Mon, Aug 4, 2008 at 8:14 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > >> >> I agree -- seeing the NumPy-related build warnings would be very useful. > > I did not anticipate people would disagree on the idea of removing > warnings, so I gu

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread David Cournapeau
On Mon, Aug 4, 2008 at 8:31 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > But how many methods do arrays and types have? As many as 1500? With autogenerated code, it is not difficult to imagine so many warnings. >I think it > is a bad idea to work around these sort of things. If self is nee

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread Charles R Harris
On Sun, Aug 3, 2008 at 6:02 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > On Mon, Aug 4, 2008 at 12:35 AM, Charles R Harris > <[EMAIL PROTECTED]> wrote: > > > > > I say leave these warnings alone. If nothing else, they point to possible > > cleanups in some future refactoring. > > Not really,

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread David Cournapeau
On Mon, Aug 4, 2008 at 8:14 AM, Stéfan van der Walt <[EMAIL PROTECTED]> wrote: > > I agree -- seeing the NumPy-related build warnings would be very useful. I did not anticipate people would disagree on the idea of removing warnings, so I guess thare are two questions: - why / why not removing bo

Re: [Numpy-discussion] Renaming MaskedArray._basedict

2008-08-03 Thread Eric Firing
Pierre GM wrote: > All, > I intend to rename a little-known attribute of MaskedArray, _basedict, to > something more understandable such as _optinfo. This attribute is a > dictionary that comes handy when subclassing MaskedArray or to save > information. > _basedict would still be available for

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread Stéfan van der Walt
Hi David 2008/8/4 David Cournapeau <[EMAIL PROTECTED]>: > Also, having hundred of bogus warnings mean you never see the > interesting ones (building numpy core alone with -W generates > 1500 > such bogus warnings...) I agree -- seeing the NumPy-related build warnings would be very useful. Do you

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread David Cournapeau
On Mon, Aug 4, 2008 at 12:35 AM, Charles R Harris <[EMAIL PROTECTED]> wrote: > > I say leave these warnings alone. If nothing else, they point to possible > cleanups in some future refactoring. Not really, because they are inherent to the way the Python C API works (the first argument of any pyth

Re: [Numpy-discussion] Renaming MaskedArray._basedict

2008-08-03 Thread Pierre GM
On Sunday 03 August 2008 16:31:33 Nathan Bell wrote: > On Sun, Aug 3, 2008 at 1:29 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > Can you could trap it in __getattr_ instead? For instance: > http://projects.scipy.org/scipy/scipy/browser/trunk/scipy/sparse/csr.py#L87 I could but I don't want to. Mask

Re: [Numpy-discussion] Renaming MaskedArray._basedict

2008-08-03 Thread Nathan Bell
On Sun, Aug 3, 2008 at 1:29 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > > I intend to put a DeprecationWarning at the beginning of numpy.ma.core. A > side-effect is that this warning is issued each time numpy.ma is imported, > which clutters the output of the tests. > Am I missing something ? Can y

[Numpy-discussion] Renaming MaskedArray._basedict

2008-08-03 Thread Pierre GM
All, I intend to rename a little-known attribute of MaskedArray, _basedict, to something more understandable such as _optinfo. This attribute is a dictionary that comes handy when subclassing MaskedArray or to save information. _basedict would still be available for a while as an alias to _opti

Re: [Numpy-discussion] member1d and unique elements

2008-08-03 Thread Gael Varoquaux
On Sun, Aug 03, 2008 at 07:16:42PM +0200, Stéfan van der Walt wrote: > 2008/8/3 Greg Novak <[EMAIL PROTECTED]>: > > First of all, my desired operation is well-posed: I'd like f(ar1, > > ar2) to return something in the shape of ar1 with True if the value at > > that position appears anywhere in ar2

Re: [Numpy-discussion] member1d and unique elements

2008-08-03 Thread Stéfan van der Walt
2008/8/3 Greg Novak <[EMAIL PROTECTED]>: > First of all, my desired operation is well-posed: I'd like f(ar1, > ar2) to return something in the shape of ar1 with True if the value at > that position appears anywhere in ar2 (regardless of duplication) and > False otherwise. Just because one-liners

[Numpy-discussion] member1d and unique elements

2008-08-03 Thread Greg Novak
I have two arrays of integers, and would like to know _where_ they have elements in common, not just _which_ elements are in common. This is because the entries in the integer array are aligned with other arrays. This seems very close to what member1d advertises as its function. However, member1d

Re: [Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread Charles R Harris
On Sun, Aug 3, 2008 at 5:25 AM, David Cournapeau < [EMAIL PROTECTED]> wrote: > Hi, > >I have recently tried various warning flags with numpy, and already > discover > several potential errors in the C code. Now, because of the huge amount of > warning > we get with e.g. -W -Wall, it would be n

Re: [Numpy-discussion] Bilteral filter

2008-08-03 Thread David Bolme
I am building up a python Computer Vision / Image Processing library built on PIL/Scipy. If you cannot find a home for this code in scipy I think it would be a good fit for this library. http://pyvision.sourceforge.net Dave On Aug 3, 2008, at 3:26 AM, Nadav Horesh wrote: > My main disapp

[Numpy-discussion] Toward a numpy build with warning: handling unused variable

2008-08-03 Thread David Cournapeau
Hi, I have recently tried various warning flags with numpy, and already discover several potential errors in the C code. Now, because of the huge amount of warning we get with e.g. -W -Wall, it would be nice to clean the code for this kind of warning 'level' because we have a huge amount of g

Re: [Numpy-discussion] Bilteral filter

2008-08-03 Thread Nadav Horesh
My main disappointment from python is that I could not donate code to its libraries (beside 3 small functions) because others made it before me. I hoped that I would have the same luck this time ;) I have a prototype in cython that I am experimenting with. I'll publish it within few days unless