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

2009-03-13 Thread Stéfan van der Walt
Hey Travis! 2009/3/13 Travis E. Oliphant oliph...@enthought.com: 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

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

2009-03-13 Thread Robert Kern
On Fri, Mar 13, 2009 at 00:42, David Cournapeau da...@ar.media.kyoto-u.ac.jp 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

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

2009-03-13 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 tightly as it

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

2009-03-13 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:02, David Cournapeau da...@ar.media.kyoto-u.ac.jp 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

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

2009-03-13 Thread Dag Sverre Seljebotn
Robert Kern wrote: On Thu, Mar 12, 2009 at 17:45, Sturla Molden stu...@molden.no wrote: 2009/3/13 Charles R Harris charlesr.har...@gmail.com: 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

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

2009-03-13 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: ImportError

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

2009-03-13 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn da...@student.matnat.uio.no 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,   #

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

2009-03-13 Thread Robert Kern
On Fri, Mar 13, 2009 at 01:13, David Cournapeau da...@ar.media.kyoto-u.ac.jp 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] A question about import in numpy and in place build

2009-03-13 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] Poll: Semantics for % in Cython

2009-03-13 Thread Fernando Perez
On Thu, Mar 12, 2009 at 11:34 PM, Robert Kern robert.k...@gmail.com wrote: One possibility (that may be opening a can of worms) is to have two sets of operators, one that does native semantics (C for cdef longs, Python for Python ints) and one that does Python semantics even on cdef longs. I

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

2009-03-13 Thread Dag Sverre Seljebotn
Fernando Perez wrote: On Thu, Mar 12, 2009 at 11:34 PM, Robert Kern robert.k...@gmail.com wrote: One possibility (that may be opening a can of worms) is to have two sets of operators, one that does native semantics (C for cdef longs, Python for Python ints) and one that does Python

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

2009-03-13 Thread Vincent Schut
Travis E. Oliphant wrote: shuwj5...@163.com wrote: snipsnip Travis, thanks for the excellent explanation! It clears something which I think is related to this, I've been wanting to ask on the ml for some time already. Now here's the case. I often have 4d arrays that are actually related sets

[Numpy-discussion] Sorting large numbers of co-ordinate pairs

2009-03-13 Thread Dinesh B Vadhia
I have a large number ( 1bn) of (32-bit) integer co-ordinates (i, j) in a file. The i are ordered and the j unordered eg. ... 6940, 22886 6940, 38277 6940, 43788 7007, 0 7007, 2362 7007, 34 etc. ... I want to create (j, i) with j ordered and i unordered and store in a file ie. ... 38277, 567

Re: [Numpy-discussion] Sorting large numbers of co-ordinate pairs

2009-03-13 Thread Sturla Molden
If you just want i to be unordered, use numpy.argsort on j. S.M. I have a large number ( 1bn) of (32-bit) integer co-ordinates (i, j) in a file. The i are ordered and the j unordered eg. ... 6940, 22886 6940, 38277 6940, 43788 7007, 0 7007, 2362 7007, 34 etc. ... I want to create

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

2009-03-13 Thread Sturla Molden
On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn   # Explicitly declared C types?   cdef long i, j, k   i = -1   j = 5   k = i % j This one is what I'm really asking about. My opinion on this is that C semantics have been explicitly requested, so they should be used. I agree with

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

2009-03-13 Thread Dag Sverre Seljebotn
Sturla Molden wrote: On Fri, Mar 13, 2009 at 01:41, Dag Sverre Seljebotn # Explicitly declared C types? cdef long i, j, k i = -1 j = 5 k = i % j This one is what I'm really asking about. My opinion on this is that C semantics have been explicitly

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

2009-03-13 Thread Sturla Molden
On 3/13/2009 12:47 PM, Dag Sverre Seljebotn wrote: (Introducing a new set of types for typed Python is an idea that could please everybody, but I fear the confusion it would bring myself...) AFAIK, Python 3 has optional type annotations. Sturla Molden

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

2009-03-13 Thread Christopher Barker
Robert Kern wrote: # Explicitly declared C types? cdef long i, j, k i = -1 j = 5 k = i % j This one is what I'm really asking about. My opinion on this is that C semantics have been explicitly requested, so they should be used. maybe ... One possibility (that may be opening

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

2009-03-13 Thread Christopher Barker
David Cournapeau wrote: On Thu, Mar 12, 2009 at 8:08 PM, Jon Wright wri...@esrf.fr 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

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

2009-03-13 Thread Stéfan van der Walt
2009/3/12 David Cournapeau courn...@gmail.com: Sorry, the link is http://codereview.appspot.com/26052/show I've tried the patch, and it works well! Bonus marks for all the useful comments and tests! I am +1. Cheers Stéfan ___ Numpy-discussion

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

2009-03-13 Thread David Cournapeau
On Sat, Mar 14, 2009 at 1:00 AM, Christopher Barker chris.bar...@noaa.gov wrote: David Cournapeau wrote: On Thu, Mar 12, 2009 at 8:08 PM, Jon Wright wri...@esrf.fr wrote: I'd like to have numpy as a dependency being pulled into a virtualenv automatically. Is that possible with the binary

[Numpy-discussion] [ANN] PyTables 2.1.1 released

2009-03-13 Thread Francesc Alted
=== Announcing PyTables 2.1.1 === PyTables is a library for managing hierarchical datasets and designed to efficiently cope with extremely large amounts of data with support for full 64-bit file addressing. PyTables runs on top of the HDF5 library

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

2009-03-13 Thread Jon Wright
David Cournapeau wrote: I now remember that numpy could not be built from sources by easy_install, but I believe we fixed the problem. Would you mind using on a recent svn checkout ? I would like this to be fixed if that's still a problem, With the current svn (6661) I can build using

[Numpy-discussion] random number generator--problems?

2009-03-13 Thread JJ
Hello: I just ran across this article saying that the random number generator in Linux is broken. http://www-cdf.fnal.gov/publications/cdf6850_badrand.pdf The article starts: The main purpose of this note is to exhibit a defect in the Linux C and C++ standard library pseudo-random number

Re: [Numpy-discussion] random number generator--problems?

2009-03-13 Thread Robert Kern
On Fri, Mar 13, 2009 at 13:16, JJ josh8...@yahoo.com wrote: Hello: I just ran across this article saying that the random number generator in Linux is broken. http://www-cdf.fnal.gov/publications/cdf6850_badrand.pdf The article starts: The main purpose of this note is to exhibit a defect

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

2009-03-13 Thread David Cournapeau
On Sat, Mar 14, 2009 at 3:15 AM, Jon Wright wri...@esrf.fr wrote: What I want is a simpler way to install things for people to try out our programs. We currently have dependencies on at least numpy, matplotlib, PIL, Pmw and PyOpenGl and having to go through a series of 6 different

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

2009-03-13 Thread Robert Kern
On Fri, Mar 13, 2009 at 12:14, David Cournapeau courn...@gmail.com wrote: But then what's the point of installing numpy in virtualenv ? Why not installing it system-wide ? The whole business of pushing people to install multiple versions of the same package for actual deployment is very wrong

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

2009-03-13 Thread Christopher Barker
David Cournapeau wrote: It depends on how much resource you can spend on it, but if I were to distribute things on windows, I would build a msi/bdist_wininst of every package, and wrap this into another installer (which is almost exactly what the superpack does). This would stomp on the

[Numpy-discussion] Build Failure on IA64

2009-03-13 Thread Patrick Marsh
Hi, I'm trying to build numpy from SVN and ran across this error: numpy/core/include/numpy/npy_cpu.h:44:10: error: #error Unknown CPU, please report this to numpy maintainers with information about your platform (OS, CPU and compiler) This is on a linux machine using gcc. Here is the processor

Re: [Numpy-discussion] Build Failure on IA64

2009-03-13 Thread Charles R Harris
On Fri, Mar 13, 2009 at 2:15 PM, Patrick Marsh patrickmars...@gmail.comwrote: Hi, I'm trying to build numpy from SVN and ran across this error: numpy/core/include/numpy/npy_cpu.h:44:10: error: #error Unknown CPU, please report this to numpy maintainers with information about your platform

Re: [Numpy-discussion] Build Failure on IA64

2009-03-13 Thread Charles R Harris
On Fri, Mar 13, 2009 at 2:15 PM, Patrick Marsh patrickmars...@gmail.comwrote: Hi, I'm trying to build numpy from SVN and ran across this error: numpy/core/include/numpy/npy_cpu.h:44:10: error: #error Unknown CPU, please report this to numpy maintainers with information about your platform

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

2009-03-13 Thread David Cournapeau
On Sat, Mar 14, 2009 at 3:37 AM, Robert Kern robert.k...@gmail.com wrote: On Fri, Mar 13, 2009 at 12:14, David Cournapeau courn...@gmail.com wrote: But then what's the point of installing numpy in virtualenv ? Why not installing it system-wide ? The whole business of pushing people to install

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

2009-03-13 Thread David Cournapeau
On Sat, Mar 14, 2009 at 4:22 AM, Christopher Barker chris.bar...@noaa.gov wrote: They will install everything needed. I think bbfreeze even supplies a custom interpreter, so you can essentially build a custom python distro with it. I think it is a much better solution. Maybe it is just me,