Re: [Numpy-discussion] A question about import in numpy and in place build

2009-03-12 Thread David Cournapeau
Robert Kern wrote: > > There shouldn't need to be (and also, there shouldn't be, in this > case). That's an odd bug in nose, then. It should be able to import a > module from a package. Nothing needs to be in __init__.py for that to > work. > > FWIW, I just change to a different directory, and the

Re: [Numpy-discussion] A question about import in numpy and in place build

2009-03-12 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:13, David Cournapeau wrote: > Robert Kern wrote: >>> Is adding additional imports fine too ? Or should we fix those in the >>> unittest instead to avoid more namespace pollution ? >>> >> >> What do you mean? >> >> > > For example, we have: > > ===

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn wrote: > Robert Kern wrote: >> That may be part of the confusion. The expression "-1%5" has no >> variables. Perhaps Dag can clarify what he is asking about: >> >>   # Constants?  (No one uses just constants in expressions, >>   # really, but co

Re: [Numpy-discussion] A question about import in numpy and in place build

2009-03-12 Thread David Cournapeau
Robert Kern wrote: >> Is adding additional imports fine too ? Or should we fix those in the >> unittest instead to avoid more namespace pollution ? >> > > What do you mean? > > For example, we have: == ERROR: Failure: Imp

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Dag Sverre Seljebotn
Robert Kern wrote: > On Thu, Mar 12, 2009 at 17:45, Sturla Molden wrote: >> >> >> >>> 2009/3/13 Charles R Harris : That said, I think it best to leave '%' with its C default and add a special modulus function for the python version. Changing its meaning in C-like code is g

Re: [Numpy-discussion] A question about import in numpy and in place build

2009-03-12 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:02, David Cournapeau wrote: > Robert Kern wrote: >> >> When it does work, the reason is because the import mechanism will >> place the "numeric" module into the "numpy.core" namespace as soon as >> it can, so it is usually available in the __init__ after a "from >> numer

Re: [Numpy-discussion] A question about import in numpy and in place build

2009-03-12 Thread David Cournapeau
Robert Kern wrote: > > When it does work, the reason is because the import mechanism will > place the "numeric" module into the "numpy.core" namespace as soon as > it can, so it is usually available in the __init__ after a "from > numeric import *". nose tries to control imports a little more tight

Re: [Numpy-discussion] A question about import in numpy and in place build

2009-03-12 Thread Robert Kern
On Fri, Mar 13, 2009 at 00:42, David Cournapeau wrote: > Hi, > >    While making sure in-place builds work, I got the following problem: > > python setup.py build_ext -i > python -c "import numpy as np; np.test()" > -> many errors > > The error are all import errors: > > Traceback (most recent cal

Re: [Numpy-discussion] is it a bug?

2009-03-12 Thread Stéfan van der Walt
Hey Travis! 2009/3/13 Travis E. Oliphant : > Referencing my previous post on this topic.   In this case, it is > unambiguous to replace dimensions 1 and 2 with the result of > broadcasting idx and idx together.   Thus the (5,6) dimensions is > replaced by the (2,) result of indexing leaving the ou

[Numpy-discussion] A question about import in numpy and in place build

2009-03-12 Thread David Cournapeau
Hi, While making sure in-place builds work, I got the following problem: python setup.py build_ext -i python -c "import numpy as np; np.test()" -> many errors The error are all import errors: Traceback (most recent call last): File "/usr/media/src/dsp/numpy/git/numpy/tests/test_ctypeslib.

Re: [Numpy-discussion] is it a bug?

2009-03-12 Thread Travis E. Oliphant
Robert Kern wrote: > On Thu, Mar 12, 2009 at 01:34, Stéfan van der Walt wrote: > >> 2009/3/12 Robert Kern : >> idx = np.array([0,1]) e = x[0,:,idx] print e.shape #-> return (2,3). I think the right answer should be (3,2). Is # it a bug here? my numpy

Re: [Numpy-discussion] is it a bug?

2009-03-12 Thread Travis E. Oliphant
shuwj5...@163.com wrote: >> >> It's certainly weird, but it's working as designed. Fancy indexing via >> arrays is a separate subsystem from indexing via slices. Basically, >> fancy indexing decides the outermost shape of the result (e.g. the >> leftmost items in the shape tuple). If there are any

Re: [Numpy-discussion] numpy via easy_install on windows

2009-03-12 Thread David Cournapeau
On Thu, Mar 12, 2009 at 8:08 PM, Jon Wright wrote: > > I'd like to have numpy as a dependency being pulled into a virtualenv > automatically. Is that possible with the binary installer? I don't think so - but I would think that people using virtualenv are familiar with compiling softwares. I no

Re: [Numpy-discussion] is it a bug?

2009-03-12 Thread Robert Kern
On Thu, Mar 12, 2009 at 01:34, Stéfan van der Walt wrote: > 2009/3/12 Robert Kern : >>> idx = np.array([0,1]) >>> e = x[0,:,idx] >>> print e.shape >>> >>> #-> return (2,3). I think the right answer should be (3,2). Is >>> #       it a bug here? my numpy version is 1.2.1. >> >> It's certainly w

Re: [Numpy-discussion] is it a bug?

2009-03-12 Thread shuwj5...@163.com
> > On Wed, Mar 11, 2009 at 19:55, shuwj5...@163.com wrote: > > Hi, > > > > import numpy as np > > x = np.arange(30) > > x.shape = (2,3,5) > > > > idx = np.array([0,1]) > > e = x[0,idx,:] > > print e.shape > > #> return (2,5). ok. > > > > idx = np.array([0,1]) > > e = x[0,:,idx] > > print e.s

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Robert Kern
On Thu, Mar 12, 2009 at 17:45, Sturla Molden wrote: > > > > >> 2009/3/13 Charles R Harris : >>> That said, I think it best to leave '%' with its C default and add a >>> special >>> modulus function for the python version. Changing its meaning in C-like >>> code >>> is going to confuse things. >> >

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Sturla Molden
> 2009/3/13 Charles R Harris : >> That said, I think it best to leave '%' with its C default and add a >> special >> modulus function for the python version. Changing its meaning in C-like >> code >> is going to confuse things. > > This is Cython code, so I think there is an argument to be made

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Stéfan van der Walt
2009/3/13 Charles R Harris : > That said, I think it best to leave '%' with its C default and add a special > modulus function for the python version. Changing its meaning in C-like code > is going to confuse things. This is Cython code, so I think there is an argument to be made that it is Python

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Charles R Harris
On Thu, Mar 12, 2009 at 12:59 PM, Dag Sverre Seljebotn < da...@student.matnat.uio.no> wrote: > (First off, is it OK to continue polling the NumPy list now and then on > Cython language decisions? Or should I expect that any interested Cython > users follow the Cython list?) > > In Python, if I wri

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Stéfan van der Walt
Hi Dag 2009/3/12 Dag Sverre Seljebotn : > (First off, is it OK to continue polling the NumPy list now and then on > Cython language decisions? Or should I expect that any interested Cython > users follow the Cython list?) Given that many of the subscribers make use of the NumPy support in Cython,

Re: [Numpy-discussion] Portable macro to get NAN, INF, positive and negative zero

2009-03-12 Thread Bruce Southey
David Cournapeau wrote: > On Thu, Mar 12, 2009 at 10:19 PM, Bruce Southey wrote: > >> David Cournapeau wrote: >> >>> Hi, >>> >>> For the record, I have just added the following functionalities to >>> numpy, which may simplify some C code: >>> - NPY_NAN/NPY_INFINITY/NPY_PZERO/NPY_NZ

[Numpy-discussion] Numpy and Scientific Python

2009-03-12 Thread vincent . thierion
Hello, I use numpy and Scientific Numpy for my work. I installed them in a manner I can use them on remote OS in copying them and using sys.path.append. Many times it works, but sometimes (depending on Python version) I receive this error : ImportError: $MYLIBFOLDER/site-packages/ numpy/core/

Re: [Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Gael Varoquaux
On Thu, Mar 12, 2009 at 07:59:48PM +0100, Dag Sverre Seljebotn wrote: > (First off, is it OK to continue polling the NumPy list now and then on > Cython language decisions? Or should I expect that any interested Cython > users follow the Cython list?) Yes, IMHO. > In Python, if I write "-1 % 5"

[Numpy-discussion] Poll: Semantics for % in Cython

2009-03-12 Thread Dag Sverre Seljebotn
(First off, is it OK to continue polling the NumPy list now and then on Cython language decisions? Or should I expect that any interested Cython users follow the Cython list?) In Python, if I write "-1 % 5", I get 4. However, in C if I write "-1 % 5" I get -1. The question is, what should I get

Re: [Numpy-discussion] [SciPy-user] numpy aligned memory

2009-03-12 Thread Sturla Molden
On 3/12/2009 4:05 PM, Andrew Straw wrote: > So, what's your take on having each row aligned? Is this also useful for > FFTW, for example? If so, we should perhaps come up with a better > routine for the cookbook. Ok, so here is how it could be done. It fails for a reason I'll attribute to a bu

Re: [Numpy-discussion] Error building SciPy SVN with NumPy SVN

2009-03-12 Thread Ryan May
On Thu, Mar 12, 2009 at 12:00 PM, David Cournapeau wrote: > On Fri, Mar 13, 2009 at 12:10 AM, Ryan May wrote: > > On Thu, Mar 12, 2009 at 9:55 AM, David Cournapeau > > wrote: > >> > >> On Thu, Mar 12, 2009 at 11:23 PM, Ryan May wrote: > >> > >> > > >> > Fixed for me. I get a segfault running s

Re: [Numpy-discussion] Error building SciPy SVN with NumPy SVN

2009-03-12 Thread David Cournapeau
On Fri, Mar 13, 2009 at 12:10 AM, Ryan May wrote: > On Thu, Mar 12, 2009 at 9:55 AM, David Cournapeau > wrote: >> >> On Thu, Mar 12, 2009 at 11:23 PM, Ryan May wrote: >> >> > >> > Fixed for me.  I get a segfault running scipy.test(), but that's >> > probably >> > due to MKL. >> >> Yes, it is. Sc

Re: [Numpy-discussion] Intel MKL on Core2 system

2009-03-12 Thread Ryan May
On Thu, Mar 12, 2009 at 10:11 AM, Francesc Alted wrote: > A Thursday 12 March 2009, Ryan May escrigué: > > I can get it working now with either the [mkl] section like your > > config or the following config: > > > > [DEFAULT] > > include_dirs = /opt/intel/mkl/10.0.2.018/include/ > > library_dirs =

Re: [Numpy-discussion] Intel MKL on Core2 system

2009-03-12 Thread Francesc Alted
A Thursday 12 March 2009, Ryan May escrigué: > I can get it working now with either the [mkl] section like your > config or the following config: > > [DEFAULT] > include_dirs = /opt/intel/mkl/10.0.2.018/include/ > library_dirs = /opt/intel/mkl/10.0.2.018/lib/em64t/:/usr/lib

Re: [Numpy-discussion] Error building SciPy SVN with NumPy SVN

2009-03-12 Thread Ryan May
On Thu, Mar 12, 2009 at 9:55 AM, David Cournapeau wrote: > On Thu, Mar 12, 2009 at 11:23 PM, Ryan May wrote: > > > > > Fixed for me. I get a segfault running scipy.test(), but that's probably > > due to MKL. > > Yes, it is. Scipy run the test suite fine for me. > While scipy builds, matplotlib'

Re: [Numpy-discussion] Error building SciPy SVN with NumPy SVN

2009-03-12 Thread David Cournapeau
On Thu, Mar 12, 2009 at 11:23 PM, Ryan May wrote: > > Fixed for me.  I get a segfault running scipy.test(), but that's probably > due to MKL. Yes, it is. Scipy run the test suite fine for me. David ___ Numpy-discussion mailing list Numpy-discussion@sc

Re: [Numpy-discussion] Error building SciPy SVN with NumPy SVN

2009-03-12 Thread Ryan May
On Thu, Mar 12, 2009 at 9:02 AM, David Cournapeau wrote: > On Thu, Mar 12, 2009 at 5:25 AM, Ryan May wrote: > > > That's fine. I just wanted to make sure I didn't do something weird > while > > getting numpy built with MKL. > > It should be fixed in r6650 > Fixed for me. I get a segfault runni

Re: [Numpy-discussion] Error building SciPy SVN with NumPy SVN

2009-03-12 Thread David Cournapeau
On Thu, Mar 12, 2009 at 5:25 AM, Ryan May wrote: > That's fine.  I just wanted to make sure I didn't do something weird while > getting numpy built with MKL. It should be fixed in r6650 David ___ Numpy-discussion mailing list Numpy-discussion@scipy.or

Re: [Numpy-discussion] Intel MKL on Core2 system

2009-03-12 Thread Ryan May
On Thu, Mar 12, 2009 at 8:30 AM, David Cournapeau < da...@ar.media.kyoto-u.ac.jp> wrote: > Ryan May wrote: > > > > [DEFAULT] > > include_dirs = /opt/intel/mkl/10.0.2.018/include/ > > > > library_dirs = /opt/intel/mkl/10.0.2.018/lib/em64t/:/usr/lib > >

Re: [Numpy-discussion] Intel MKL on Core2 system

2009-03-12 Thread David Cournapeau
Ryan May wrote: > > [DEFAULT] > include_dirs = /opt/intel/mkl/10.0.2.018/include/ > > library_dirs = /opt/intel/mkl/10.0.2.018/lib/em64t/:/usr/lib > > > [blas] > libraries = mkl_gf_lp64, mkl_gnu_thread, mkl_core, iomp5 > > [lapack

Re: [Numpy-discussion] Portable macro to get NAN, INF, positive and negative zero

2009-03-12 Thread David Cournapeau
On Thu, Mar 12, 2009 at 10:19 PM, Bruce Southey wrote: > David Cournapeau wrote: >> Hi, >> >>     For the record, I have just added the following functionalities to >> numpy, which may simplify some C code: >>     - NPY_NAN/NPY_INFINITY/NPY_PZERO/NPY_NZERO: macros to get nan, inf, >> positive and

Re: [Numpy-discussion] Intel MKL on Core2 system

2009-03-12 Thread Ryan May
On Thu, Mar 12, 2009 at 3:05 AM, Francesc Alted wrote: > A Wednesday 11 March 2009, Ryan May escrigué: > > Thanks. That's actually pretty close to what I had. I was actually > > thinking that you were using only blas_opt and lapack_opt, since > > supposedly the [mkl] style section is deprecated

Re: [Numpy-discussion] Implementing hashing protocol for dtypes

2009-03-12 Thread David Cournapeau
Stéfan van der Walt wrote: > 2009/3/12 David Cournapeau : > >> Anyway, here is a first shot at it: >> >> http://codereview.appspot.com/26052 >> > > Design question: should [('x', float), ('y', float)] and [('t', > float), ('s', float)] hash to the same value or not? > According to: htt

Re: [Numpy-discussion] Portable macro to get NAN, INF, positive and negative zero

2009-03-12 Thread Bruce Southey
David Cournapeau wrote: > Hi, > > For the record, I have just added the following functionalities to > numpy, which may simplify some C code: > - NPY_NAN/NPY_INFINITY/NPY_PZERO/NPY_NZERO: macros to get nan, inf, > positive and negative zeros. Rationale: some code use NAN, _get_nan, > etc...

Re: [Numpy-discussion] Implementing hashing protocol for dtypes

2009-03-12 Thread Stéfan van der Walt
2009/3/12 David Cournapeau : > Anyway, here is a first shot at it: > > http://codereview.appspot.com/26052 Design question: should [('x', float), ('y', float)] and [('t', float), ('s', float)] hash to the same value or not? Regards Stéfan ___ Numpy-disc

[Numpy-discussion] 1.3 release: getting rid of sourceforge ?

2009-03-12 Thread David Cournapeau
Hi, I was wondering if there was any reason for still using sourceforge ? AFAIK, we only use it to put the files there, and dealing with sourceforge to upload files is less than optimal to say the least. Is there any drawback to directly put the files to scipy.org ? cheers, David ___

Re: [Numpy-discussion] Implementing hashing protocol for dtypes

2009-03-12 Thread David Cournapeau
On Thu, Mar 12, 2009 at 9:13 PM, David Cournapeau wrote: > On Thu, Mar 12, 2009 at 1:00 PM, Robert Kern wrote: > >> >> It was an example. > > Ok, guess I will have to learn the difference between i.e. and e.g. one day. > > Anyway, here is a first shot at it: > > http://codereview.appspot.com/2605

Re: [Numpy-discussion] Implementing hashing protocol for dtypes

2009-03-12 Thread David Cournapeau
On Thu, Mar 12, 2009 at 1:00 PM, Robert Kern wrote: > > It was an example. Ok, guess I will have to learn the difference between i.e. and e.g. one day. Anyway, here is a first shot at it: http://codereview.appspot.com/26052 I added a few tests which fail with trunk and work with the patch (fo

Re: [Numpy-discussion] image processing using numpy-scipy?

2009-03-12 Thread Zachary Pincus
> did you have a look at OpenCV? > > http://sourceforge.net/projects/opencvlibrary > > Since a couple of weeks, we have implemented the numpy array > interface so data exchange is easy [check out from SVN]. Oh fantastic! That is great news indeed. Zach __

Re: [Numpy-discussion] numpy via easy_install on windows

2009-03-12 Thread Jon Wright
David Cournapeau wrote: > Hi Jon, > > Jon Wright wrote: >> Hello, >> >> If I do: >> >> C:\> easy_install numpy >> >> ... on a windows box, it attempts to do a source download and build, >> which typically doesn't work. If however I use: >> >> C:\> easy_install numpy==1.0.4 >> >> ... then the magi

Re: [Numpy-discussion] image processing using numpy-scipy?

2009-03-12 Thread Mark Asbach
Hi there, I have read the docs of PIL but there is no function for this. Can I use numpy-scipy for the matter? The image size is 1K. did you have a look at OpenCV? http://sourceforge.net/projects/opencvlibrary Since a couple of weeks, we have implemented the numpy array interface so dat

Re: [Numpy-discussion] numpy via easy_install on windows

2009-03-12 Thread David Cournapeau
Hi Jon, Jon Wright wrote: > Hello, > > If I do: > > C:\> easy_install numpy > > ... on a windows box, it attempts to do a source download and build, > which typically doesn't work. If however I use: > > C:\> easy_install numpy==1.0.4 > > ... then the magic works just fine. Any chance of a more re

[Numpy-discussion] numpy via easy_install on windows

2009-03-12 Thread Jon Wright
Hello, If I do: C:\> easy_install numpy ... on a windows box, it attempts to do a source download and build, which typically doesn't work. If however I use: C:\> easy_install numpy==1.0.4 ... then the magic works just fine. Any chance of a more recent bdist_egg being made available for windo

Re: [Numpy-discussion] code performanceon windows (32 and/or 64 bit) using SWIG: C++ compiler MS vs.cygwin

2009-03-12 Thread David Cournapeau
Sebastian Haase wrote: > On Thu, Mar 12, 2009 at 4:39 AM, David Cournapeau wrote: > >> On Thu, Mar 12, 2009 at 12:38 PM, David Cournapeau >> wrote: >> >>> and you can't >>> cross compile easily. >>> >> Of course, this applies to numpy/scipy - you can cross compile your >> own exte

Re: [Numpy-discussion] code performanceon windows (32 and/or 64 bit) using SWIG: C++ compiler MS vs.cygwin

2009-03-12 Thread Sebastian Haase
On Thu, Mar 12, 2009 at 4:39 AM, David Cournapeau wrote: > On Thu, Mar 12, 2009 at 12:38 PM, David Cournapeau wrote: >> and you can't >> cross compile easily. > > Of course, this applies to numpy/scipy - you can cross compile your > own extensions relatively easily (at least I don't see why it wo

Re: [Numpy-discussion] Intel MKL on Core2 system

2009-03-12 Thread Francesc Alted
A Wednesday 11 March 2009, Ryan May escrigué: > Thanks. That's actually pretty close to what I had. I was actually > thinking that you were using only blas_opt and lapack_opt, since > supposedly the [mkl] style section is deprecated. Thus far, I cannot > get these to work with MKL. Well, my con