Re: [Numpy-discussion] Getting number of *characters* in dtype='U' array

2009-09-25 Thread David Warde-Farley
On Fri, Sep 25, 2009 at 09:15:49PM -0500, Robert Kern wrote: > > I could be misleading you but I believe x.dtype.alignment is the divisor > > for itemsize that you're looking for? > > Only by happenstance. It is not really related. Yikes, my guess was quite wrong indeed. http://docs.scipy.org/

Re: [Numpy-discussion] Getting number of *characters* in dtype='U' array

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 20:40, David Warde-Farley wrote: > On Fri, Sep 25, 2009 at 11:33:17AM -0400, Michael Droettboom wrote: >> Is there a way to get the number of characters in a fixed-size 'U' >> array?  I can, of course, parse dtype.str, or divide dtype.itemsize by >> the size of a unicode ch

Re: [Numpy-discussion] Getting number of *characters* in dtype='U' array

2009-09-25 Thread David Warde-Farley
On Fri, Sep 25, 2009 at 11:33:17AM -0400, Michael Droettboom wrote: > Is there a way to get the number of characters in a fixed-size 'U' > array? I can, of course, parse dtype.str, or divide dtype.itemsize by > the size of a unicode character, but neither seems terribly elegant or > future proo

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Alan G Isaac
> Alan G Isaac wrote: >> That's just a slow implementation of meshgrid: >> np.meshgrid(a,b).transpose().tolist() >> Gives you the same thing. On 9/25/2009 6:38 PM, Mads Ipsen wrote: > Yes, but it should also work for [2.1,3.2,4.5] combined with > [4.6,-2.3,5.6] - forgot to tell that. No problem:

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Alan G Isaac
OK, sure, for large arrays meshgrid will look bad. (It creates a large array twice.) If the example really involves sequential integers, then mgrid could be used instead to save on this. Even so, it is just implausible that duplicating meshgrid functionality will be faster than using meshgrid. So

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Skipper Seabold
On Fri, Sep 25, 2009 at 3:51 PM, Christopher Barker wrote: > One more thought: > > Pierre GM wrote: That way, we don't slow things down when everything works, > > how long can it really take to increment an integer as each line is > parsed? I'd suspect no one would even notice! > A 1000

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 17:38, Mads Ipsen wrote: > Yes, but it should also work for [2.1,3.2,4.5] combined with > [4.6,-2.3,5.6] - forgot to tell that. In [5]: np.transpose(np.meshgrid([2.1,3.2,4.5], [4.6,-2.3,5.6])) Out[5]: array([[[ 2.1, 4.6], [ 2.1, -2.3], [ 2.1, 5.6]],

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
Alan G Isaac wrote: > On 9/25/2009 4:01 PM, Mads Ipsen wrote: > >> a = numpy.array([1,2,3]) >> b = numpy.array([4,5,6]) >> >> (n,m) = (a.shape[0],b.shape[0]) >> a = numpy.repeat(a,m).reshape(n,m) >> b = numpy.repeat(b,n).reshape(m,n).transpose() >> ab = numpy.dstack((a,b)) >> >> print ab.tolist(

Re: [Numpy-discussion] genfromtxt to structured array

2009-09-25 Thread Ryan May
On Fri, Sep 25, 2009 at 4:30 PM, Timmie wrote: > Hello, > this may be a easier question. > > I want to load data into an structured array with getting the names from the > column header (names=True). > > The data looks like: > >    ;month;day;hour;value >    1995;1;1;01;0 > > > but loading only wo

[Numpy-discussion] genfromtxt to structured array

2009-09-25 Thread Timmie
Hello, this may be a easier question. I want to load data into an structured array with getting the names from the column header (names=True). The data looks like: ;month;day;hour;value 1995;1;1;01;0 but loading only works only if changed to: year;month;day;hour;value

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Keith Goodman
On Fri, Sep 25, 2009 at 1:37 PM, Gökhan Sever wrote: > Yes this is super fast indeed :) > > with 1x1 > > I[12]: %time run test.py > CPU times: user 6.14 s, sys: 1.83 s, total: 7.97 s > Wall time: 8.25 s > > #test.py > > import numpy > > a = numpy.arange(1) > b = numpy.arange(1) > >

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Neil Martinsen-Burrell
On 2009-09-25 15:36 , Arthur Bousquet wrote: > Thanks a lot for you help. Now it is working, I downloaded the gfortran > from http://hpc.sourceforge.net/. I will take the opportunity to steal Robert's line and say that the gfortran available from that site has had numerous problems in the past.

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Alan G Isaac
On 9/25/2009 4:01 PM, Mads Ipsen wrote: > a = numpy.array([1,2,3]) > b = numpy.array([4,5,6]) > > (n,m) = (a.shape[0],b.shape[0]) > a = numpy.repeat(a,m).reshape(n,m) > b = numpy.repeat(b,n).reshape(m,n).transpose() > ab = numpy.dstack((a,b)) > > print ab.tolist() That's just a slow implementatio

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Gökhan Sever
On Fri, Sep 25, 2009 at 3:01 PM, Mads Ipsen wrote: > Robert Kern wrote: > > On Fri, Sep 25, 2009 at 14:19, Alan G Isaac wrote: > > > >> I do not see what is wrong with itertools.product, > >> but if you hate it, you can use numpy.meshgrid: > >> > >> > > np.array(np.meshgrid([1,2,3],[4,5,6]))

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
Thanks a lot for you help. Now it is working, I downloaded the gfortran from http://hpc.sourceforge.net/. Best regards, Arthur On Fri, Sep 25, 2009 at 3:49 PM, Arthur Bousquet wrote: > How can I add the flags ? > > Thank > > Arthur > > > On Fri, Sep 25, 2009 at 3:46 PM, Robert Kern wrote: > >> O

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
Robert Kern wrote: > On Fri, Sep 25, 2009 at 14:19, Alan G Isaac wrote: > >> I do not see what is wrong with itertools.product, >> but if you hate it, you can use numpy.meshgrid: >> >> > np.array(np.meshgrid([1,2,3],[4,5,6])).transpose() > >> array([[[1, 4], >> [

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Pierre GM
On Sep 25, 2009, at 3:56 PM, Ralf Gommers wrote: > > The examples you put in the docstring are good I think. One more > example demonstrating missing values would be useful. And +1 to a > page in the user guide for anything else. Check also what's done in tests/test_io.py, that gives an idea

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Ralf Gommers
On Fri, Sep 25, 2009 at 3:47 PM, Pierre GM wrote: > > On Sep 25, 2009, at 3:42 PM, Skipper Seabold wrote: > > > > As far as this goes, I added some examples to the docs wiki, but I > > think that genfromtxt and related would be best served by having their > > own wiki page that could maybe go her

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Pierre GM
On Sep 25, 2009, at 3:51 PM, Skipper Seabold wrote: >> >> While you're at it, can you ask for adding the possibility to process >> a dtype like (int,int,float) ? That was what I was working on >> before I >> started installing Snow Leopard... > > Sure. Should it be another keyword though `type`

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Skipper Seabold
On Fri, Sep 25, 2009 at 3:47 PM, Pierre GM wrote: > > On Sep 25, 2009, at 3:42 PM, Skipper Seabold wrote: >> >> As far as this goes, I added some examples to the docs wiki, but I >> think that genfromtxt and related would be best served by having their >> own wiki page that could maybe go here >>

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Christopher Barker
One more thought: Pierre GM wrote: >>> That way, we don't slow >>> things down when everything works, how long can it really take to increment an integer as each line is parsed? I'd suspect no one would even notice! >>if you don't keep track of where you are, wouldn't you >> need to re-parse t

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Pierre GM
On Sep 25, 2009, at 3:42 PM, Skipper Seabold wrote: > > As far as this goes, I added some examples to the docs wiki, but I > think that genfromtxt and related would be best served by having their > own wiki page that could maybe go here > > > Tho

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 14:44, Arthur Bousquet wrote: > $ file libsw.so gives : > > libsw.so: Mach-O bundle i386 > > How can I change it ? Is it because of my gfortran ? Your gfortran is probably still configured to make x86 executables by default. Try recompiling libsw.so with the flags -arch

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
$ file libsw.so gives : libsw.so: Mach-O bundle i386 How can I change it ? Is it because of my gfortran ? Thanks. - Arthur On Fri, Sep 25, 2009 at 3:30 PM, Robert Kern wrote: > On Fri, Sep 25, 2009 at 14:08, Arthur Bousquet > wrote: > > Ok, so I re-compiled python (without framework), numpy

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Skipper Seabold
On Fri, Sep 25, 2009 at 3:34 PM, Bruce Southey wrote: >>> * About the converter error: there's indeed a bug in >>> StringConverter.upgrade, I need to write some unittests to make sure I >>> get it covered. If you could get me some sample code, that'd be great. >>> >> Hmm, I'm not sure that the er

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Pierre GM
On Sep 25, 2009, at 3:12 PM, Christopher Barker wrote: > Pierre GM wrote: >> That way, we don't slow >> things down when everything works, but just add some delay when they >> don't. > > good goal, but if you don't keep track of where you are, wouldn't you > need to re-parse the whole file to fig

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Bruce Southey
On 09/25/2009 01:25 PM, Skipper Seabold wrote: > On Fri, Sep 25, 2009 at 2:17 PM, Pierre GM wrote: > >> Sorry all, I haven't been as respondent as I wished lately... >> * About the patch: I don't like the idea of adding yet some other >> tests in the main loop. I was more into letting things l

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 14:19, Alan G Isaac wrote: > I do not see what is wrong with itertools.product, > but if you hate it, you can use numpy.meshgrid: > np.array(np.meshgrid([1,2,3],[4,5,6])).transpose() > array([[[1, 4], >         [1, 5], >         [1, 6]], > >        [[2, 4], >         [

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 14:08, Arthur Bousquet wrote: > Ok, so I re-compiled python (without framework), numpy,... So I can compile > my lib (libsw) now, bu I can't called it from python. I got this error : > > Arths-MacBook-Pro:run_1 arthbous$ ./run.sh > Traceback (most recent call last): >   Fil

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Ralf Gommers
On Fri, Sep 25, 2009 at 3:08 PM, Christopher Barker wrote: > Ralf Gommers wrote: > > Probably the easiest for your purpose is this: > > > > def divbyzero(): > > return 1/0 > > > > try: > > a = divbyzero() > > except ZeroDivisionError as err: > > print 'problem occurred at line X' > >

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Alan G Isaac
I do not see what is wrong with itertools.product, but if you hate it, you can use numpy.meshgrid: >>> np.array(np.meshgrid([1,2,3],[4,5,6])).transpose() array([[[1, 4], [1, 5], [1, 6]], [[2, 4], [2, 5], [2, 6]], [[3, 4], [3, 5],

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Christopher Barker
Pierre GM wrote: > That way, we don't slow > things down when everything works, but just add some delay when they > don't. good goal, but if you don't keep track of where you are, wouldn't you need to re-parse the whole file to figure it out again? Maybe a "debug" mode that the user could tu

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
Ok, so I re-compiled python (without framework), numpy,... So I can compile my lib (libsw) now, bu I can't called it from python. I got this error : Arths-MacBook-Pro:run_1 arthbous$ ./run.sh Traceback (most recent call last): File "../main.py", line 23, in import libsw as lsw ImportError:

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Christopher Barker
Ralf Gommers wrote: > Probably the easiest for your purpose is this: > > def divbyzero(): > return 1/0 > > try: > a = divbyzero() > except ZeroDivisionError as err: > print 'problem occurred at line X' > raise err I get an error with this syntax -- is thin 2.6 only? In [10]: run

Re: [Numpy-discussion] fixed-point arithmetic

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 13:57, Neal Becker wrote: > I'm still a bit confused.  The dtype is a PyTypeObject? No, dtypes are PyArrayDescr's in C. > It almost sounds > like you're saying that the dtype is an PyObject instance, rather than a > TypeObject. Yup. > But IIUC, you say it is a PyTypeOb

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread josef . pktd
On Fri, Sep 25, 2009 at 2:53 PM, Keith Goodman wrote: > On Fri, Sep 25, 2009 at 11:05 AM, Mads Ipsen wrote: >> Sure, and you could do the same thing using two nested for loops. But >> its bound to be slow when the arrays become large (and they will). The >> question is whether it can be done in p

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Keith Goodman
On Fri, Sep 25, 2009 at 11:53 AM, Keith Goodman wrote: > On Fri, Sep 25, 2009 at 11:05 AM, Mads Ipsen wrote: >> Sure, and you could do the same thing using two nested for loops. But >> its bound to be slow when the arrays become large (and they will). The >> question is whether it can be done in

Re: [Numpy-discussion] fixed-point arithmetic

2009-09-25 Thread Neal Becker
Robert Kern wrote: > On Mon, Sep 21, 2009 at 12:39, Neal Becker wrote: > >> 1. Where would I find this new datetime dtype? > > It's in the SVN trunk. > >> 2. Don't know exactly what 'parameterized' dtypes are. Does this mean >> that the dtype for 8.1 format fixed-pt is different from the dtyp

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 13:43, Arthur Bousquet wrote: > Thank you a lot for your help. So I deleted as you said, but then I do with > --enable-framework for python, at the make there is an error : > > ln -fsn 2.6 Python.framework/Versions/Current > ln -fsn Versions/Current/Python Python.framework/

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Keith Goodman
On Fri, Sep 25, 2009 at 11:05 AM, Mads Ipsen wrote: > Sure, and you could do the same thing using two nested for loops. But > its bound to be slow when the arrays become large (and they will). The > question is whether it can be done in pure numpy. An output like > > [[[1,4],[1,5],[1,6]],[[2,4],[2

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
Thank you a lot for your help. So I deleted as you said, but then I do with --enable-framework for python, at the make there is an error : ln -fsn 2.6 Python.framework/Versions/Current ln -fsn Versions/Current/Python Python.framework/Python ln -fsn Versions/Current/Headers Python.framework/Headers

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Gökhan Sever
On Fri, Sep 25, 2009 at 1:05 PM, Mads Ipsen wrote: > Gökhan Sever wrote: > > > > > > On Fri, Sep 25, 2009 at 12:45 PM, Mads Ipsen > > wrote: > > > > Is there a numpy operation on two arrays, say [1,2,3] and [4,5,6], > > that > > will yield: > > > > [[(1,4)

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Skipper Seabold
On Fri, Sep 25, 2009 at 2:17 PM, Pierre GM wrote: > Sorry all, I haven't been as respondent as I wished lately... > * About the patch: I don't like the idea of adding yet some other > tests in the main loop. I was more into letting things like they are, > but calling some error function if some 's

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 13:02, Arthur Bousquet wrote: > I got : > > Arths-MacBook-Pro:~ arthbous$ python2.6 > ActivePython 2.6.2.2 (ActiveState Software Inc.) based on > Python 2.6.2 (r262:71600, Apr 24 2009, 21:40:46) > [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin > Type "help", "copyr

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Pierre GM
Sorry all, I haven't been as respondent as I wished lately... * About the patch: I don't like the idea of adding yet some other tests in the main loop. I was more into letting things like they are, but calling some error function if some 'setting an array element with a sequence' exception is

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Skipper Seabold
On Fri, Sep 25, 2009 at 2:03 PM, Bruce Southey wrote: > On 09/25/2009 12:00 PM, Skipper Seabold wrote: >> There have been some recent attempts to improve the error reporting in >> genfromtxt, which is >> great, because hunting down the problems reading

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Skipper Seabold
On Fri, Sep 25, 2009 at 2:00 PM, Ralf Gommers wrote: > > > On Fri, Sep 25, 2009 at 1:00 PM, Skipper Seabold > wrote: >> >> There have been some recent attempts to improve the error reporting in >> genfromtxt , which is >> great, because hunting down th

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
Gökhan Sever wrote: > > > On Fri, Sep 25, 2009 at 12:45 PM, Mads Ipsen > wrote: > > Is there a numpy operation on two arrays, say [1,2,3] and [4,5,6], > that > will yield: > > [[(1,4),(1,5),(1,6)],[(2,4),(2,5),(2,6)],[(3,4),(3,5),(3,6)]] > > Any suggesti

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
I got : Arths-MacBook-Pro:~ arthbous$ python2.6 ActivePython 2.6.2.2 (ActiveState Software Inc.) based on Python 2.6.2 (r262:71600, Apr 24 2009, 21:40:46) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Alan G Isaac
On 9/25/2009 1:45 PM, Mads Ipsen wrote: > Is there a numpy operation on two arrays, say [1,2,3] and [4,5,6], that > will yield: > > [[(1,4),(1,5),(1,6)],[(2,4),(2,5),(2,6)],[(3,4),(3,5),(3,6)]] >>> from itertools import product >>> list(product([1,2,3],[4,5,6])) [(1, 4), (1, 5), (1, 6), (2, 4), (

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Bruce Southey
On 09/25/2009 12:00 PM, Skipper Seabold wrote: > There have been some recent attempts to improve the error reporting in > genfromtxt, which is > great, because hunting down the problems reading in big and messy > files is not fun. > > I am working on a p

Re: [Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Ralf Gommers
On Fri, Sep 25, 2009 at 1:00 PM, Skipper Seabold wrote: > There have been some recent attempts to improve the error reporting in > genfromtxt , which is > great, because hunting down the problems reading in big and messy > files is not fun. > > I am wor

[Numpy-discussion] how to specify cflags from within setup.py?

2009-09-25 Thread Rob Hetland
I have an external module that I am trying to compile as part of a package. It does not like to be compiled with -O3 optimization, and requires -O2 at most. I have tried the few things I know how to do, like setting the extra_compile_args, and trying to change the CFLAGS, but these do no

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Gökhan Sever
On Fri, Sep 25, 2009 at 12:45 PM, Mads Ipsen wrote: > Is there a numpy operation on two arrays, say [1,2,3] and [4,5,6], that > will yield: > > [[(1,4),(1,5),(1,6)],[(2,4),(2,5),(2,6)],[(3,4),(3,5),(3,6)]] > > Any suggestions are most welcome. > > Mads > > I don't know if there is a function in

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 12:55, Arthur Bousquet wrote: > The first line of /usr/local/f2py2.6 is : > > #!/usr/bin/env python2.6 > # See http://cens.ioc.ee/projects/f2py2e/ And exactly which python2.6 executable do you get when you type $ python 2.6 ? Try printing sys.executable: $ python Python

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
The first line of /usr/local/f2py2.6 is : #!/usr/bin/env python2.6 # See http://cens.ioc.ee/projects/f2py2e/ - Arthur On Fri, Sep 25, 2009 at 1:51 PM, Robert Kern wrote: > On Fri, Sep 25, 2009 at 12:35, Arthur Bousquet > wrote: > > Thank you. So here the command : > > > > Arths-MacBook-Pro:~

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 12:35, Arthur Bousquet wrote: > Thank you. So here the command : > > Arths-MacBook-Pro:~ arthbous$ grep isysroot > /Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/config/Makefile > BASECFLAGS=    -arch ppc -arch i386 -isysroot > /Developer/SDKs/MacOSX10.

[Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
Is there a numpy operation on two arrays, say [1,2,3] and [4,5,6], that will yield: [[(1,4),(1,5),(1,6)],[(2,4),(2,5),(2,6)],[(3,4),(3,5),(3,6)]] Any suggestions are most welcome. Mads -- ++ | Mads Ipsen, Scientific developer

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
Thank you. So here the command : Arths-MacBook-Pro:~ arthbous$ grep isysroot /Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/config/Makefile BASECFLAGS=-arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fPIC -fno-common -dynamic LDFLAGS=

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 12:24, Arthur Bousquet wrote: > Sorry about that. > > I typed in the Terminal "grep isysroot" and it is like nothing is happening. > The terminal is still working but does not give any response. Ah, sorry about that. The command got wordwrapped. Cancel that command using C

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
Sorry about that. I typed in the Terminal "grep isysroot" and it is like nothing is happening. The terminal is still working but does not give any response. Arthur On Fri, Sep 25, 2009 at 1:21 PM, Robert Kern wrote: > On Fri, Sep 25, 2009 at 12:17, Arthur Bousquet > wrote: > > $ grep isysroot

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 12:17, Arthur Bousquet wrote: > $ grep isysroot > > does not work on my computer. What does that mean? Exactly what did you type and exactly what response did you get? Please, never just say that something "does not work". -- Robert Kern "I have come to believe that the

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
$ grep isysroot does not work on my computer. Arthur On Fri, Sep 25, 2009 at 12:27 PM, Robert Kern wrote: > On Fri, Sep 25, 2009 at 11:19, Arthur Bousquet > wrote: > > Here my full error : http://dl.getdropbox.com/u/541149/error_f2py.txt > > /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.

[Numpy-discussion] Question about improving genfromtxt errors

2009-09-25 Thread Skipper Seabold
There have been some recent attempts to improve the error reporting in genfromtxt , which is great, because hunting down the problems reading in big and messy files is not fun. I am working on a patch that keeps up with the line number and column number

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Charles R Harris
On Fri, Sep 25, 2009 at 10:29 AM, Robert Kern wrote: > On Fri, Sep 25, 2009 at 11:23, Chris Colbert wrote: > > Oh, and sorry if calling you Chuck was offensive, that's out of habit > > from a friend of mine named Charles. > > Since he signs his name "Chuck", I don't think he could reasonably get

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Chris Colbert
you sir, have a very good point :) On Fri, Sep 25, 2009 at 12:29 PM, Robert Kern wrote: > On Fri, Sep 25, 2009 at 11:23, Chris Colbert wrote: >> Oh, and sorry if calling you Chuck was offensive, that's out of habit >> from a friend of mine named Charles. > > Since he signs his name "Chuck", I do

[Numpy-discussion] Error building docs

2009-09-25 Thread Michael Droettboom
Anybody know why I might be seeing this? Cheers, Mike [~/builds/numpy_clean/doc] > make html mkdir -p build touch build/generate-stamp mkdir -p build/html build/doctrees LANG=C sphinx-build -b html -d build/doctrees source build/html Running Sphinx v1.0 (hg) 1.4.dev7413 1.4.0.dev7413 /home/mdr

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 11:23, Chris Colbert wrote: > Oh, and sorry if calling you Chuck was offensive, that's out of habit > from a friend of mine named Charles. Since he signs his name "Chuck", I don't think he could reasonably get offended by that. :-) -- Robert Kern "I have come to believe

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 11:19, Arthur Bousquet wrote: > Here my full error : http://dl.getdropbox.com/u/541149/error_f2py.txt /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory I didn't think that MacOSX10.4u.sdk existed on Snow Leopard. The "-

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Chris Colbert
Oh, and sorry if calling you Chuck was offensive, that's out of habit from a friend of mine named Charles. My apologies... On Fri, Sep 25, 2009 at 12:21 PM, Chris Colbert wrote: > here's an example from numpy/core/tests/ > > from the source directory: > > brucewa...@broo:~/builds/numpy-1.3.0/num

Re: [Numpy-discussion] [SciPy-dev] Deprecate chararray [was Plea for help]

2009-09-25 Thread David Goldsmith
Great, thanks! DG On Fri, Sep 25, 2009 at 6:07 AM, Michael Droettboom wrote: > David Goldsmith wrote: > > On Tue, Sep 22, 2009 at 4:02 PM, Ralf Gommers > > mailto:ralf.gomm...@googlemail.com>> > wrote: > > > > > > On Tue, Sep 22, 2009 at 1:58 PM, Michael Droettboom > > mailto:md...@stsc

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Chris Colbert
here's an example from numpy/core/tests/ from the source directory: brucewa...@broo:~/builds/numpy-1.3.0/numpy/core/tests$ ls -l total 244 drwxr-xr-x 2 brucewayne brucewayne 4096 2009-04-05 04:29 data -rw-r--r-- 1 brucewayne brucewayne 465 2009-03-29 07:24 test_blasdot.py -rw-r--r-- 1 bruceway

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
Here my full error : http://dl.getdropbox.com/u/541149/error_f2py.txt Thank you, Arthur On Fri, Sep 25, 2009 at 11:59 AM, Robert Kern wrote: > On Fri, Sep 25, 2009 at 10:48, Arthur Bousquet > wrote: > > I used compiler=gcc, here is the command : > > > > f2py2.6 --fcompiler=gfortran --compiler=

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Charles R Harris
On Fri, Sep 25, 2009 at 10:09 AM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Fri, Sep 25, 2009 at 9:59 AM, Chris Colbert wrote: > >> for numpy and scipy, only the tests have executable permissions. It's >> as if the tests were specifically targeted and had their permissions >> c

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Charles R Harris
On Fri, Sep 25, 2009 at 9:59 AM, Chris Colbert wrote: > for numpy and scipy, only the tests have executable permissions. It's > as if the tests were specifically targeted and had their permissions > changed. > > And these are the only two python packages i've built from source and > installed in

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 10:59, Chris Colbert wrote: > for numpy and scipy, only the tests have executable permissions. It's > as if the tests were specifically targeted and had their permissions > changed. > > And these are the only two python packages i've built from source and > installed in thi

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Chris Colbert
for numpy and scipy, only the tests have executable permissions. It's as if the tests were specifically targeted and had their permissions changed. And these are the only two python packages i've built from source and installed in this manner, other i've gotten via easy_install, or in the case of

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 10:48, Arthur Bousquet wrote: > I used compiler=gcc, here is the command : > > f2py2.6 --fcompiler=gfortran --compiler=gcc -DF2PY_REPORT_ON_ARRAY_COPY=1 -m > libsw -c file1.f90 file2.f90 > > Ok so you said that "--compiler=gcc" is not a command ? Correct. --compiler= does

Re: [Numpy-discussion] Getting number of *characters* in dtype='U' array

2009-09-25 Thread Michael Droettboom
Ah, I missed the fact that Numpy unicode characters are always 4-bytes, unlike Python unicode objects. Divide by 4 is easy enough. Sorry for the noise. Mike Michael Droettboom wrote: > Is there a way to get the number of characters in a fixed-size 'U' > array? I can, of course, parse dtype.

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
I used compiler=gcc, here is the command : f2py2.6 --fcompiler=gfortran --compiler=gcc -DF2PY_REPORT_ON_ARRAY_COPY=1 -m libsw -c file1.f90 file2.f90 Ok so you said that "--compiler=gcc" is not a command ? So I removed the line "--compiler=gcc", and I got a new error : error: Command "gcc -arch

[Numpy-discussion] Getting number of *characters* in dtype='U' array

2009-09-25 Thread Michael Droettboom
Is there a way to get the number of characters in a fixed-size 'U' array? I can, of course, parse dtype.str, or divide dtype.itemsize by the size of a unicode character, but neither seems terribly elegant or future proof. Does numpy provide (to Python) a method for getting this that I'm just

Re: [Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Robert Kern
On Fri, Sep 25, 2009 at 10:19, Arthur Bousquet wrote: > Hello, > > I have a Mac with snow leopard 10.6. I compiled Python2.6.2, numpy1.3 and > matplotlib from the sources. > I tried to compiled a library (named libsw), that I have made in fortran, > with f2py but I got the following error : > > ru

[Numpy-discussion] F2PY error : ... on platform 'posix' with 'gcc' compiler

2009-09-25 Thread Arthur Bousquet
Hello, I have a Mac with snow leopard 10.6. I compiled Python2.6.2, numpy1.3 and matplotlib from the sources. I tried to compiled a library (named libsw), that I have made in fortran, with f2py but I got the following error : running build_ext error: don't know how to compile C/C++ code on platfo

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Mark Sienkiewicz
> In the source build folder, all numpy test scripts have the correct > permissions and are not marked as executable, > > but in the install directory > (/usr/local/lib/python2.6/dist-packages/numpy/), the test test scripts > have completely different permissions, and are all marked as > executabl

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Chris Colbert
i have no clue why i'm having this problem. This is a fresh install of ubuntu as well as numpy and scipy... During the write to std out during build and install I do notice things like "changing permission for f2py from 640 to 755" or something like that. So i'm wondering if other permissions ar

Re: [Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Skipper Seabold
On Fri, Sep 25, 2009 at 10:01 AM, Chris Colbert wrote: > Sorry to bring up an old topic again, but I still haven't managed to > resolve  this issue concerning numpy and nose tests... > > On a fresh numpy 1.3.0 build from source tarball on sourceforge: > > On ubuntu 9.04 x64 I issue the following c

[Numpy-discussion] numpy install script changes permissions?

2009-09-25 Thread Chris Colbert
Sorry to bring up an old topic again, but I still haven't managed to resolve this issue concerning numpy and nose tests... On a fresh numpy 1.3.0 build from source tarball on sourceforge: On ubuntu 9.04 x64 I issue the following commands: cd numpy-1.3.0 python setup.py sudo python setup.py inst

Re: [Numpy-discussion] MFDatasets and NetCDF4

2009-09-25 Thread George Nurser
2009/9/25 David Huard : > Hi George, > > On Fri, Sep 25, 2009 at 6:55 AM, George Nurser > wrote: >> >> Hi, >> I hope this is the right place to ask this. >> I've found the MFDataset works well in reading NetCDF3 files, but it >> appears that it doesn't work at present for NetCDF4 files. >> > > It

Re: [Numpy-discussion] MFDatasets and NetCDF4

2009-09-25 Thread David Huard
Hi George, On Fri, Sep 25, 2009 at 6:55 AM, George Nurser wrote: > Hi, > I hope this is the right place to ask this. > I've found the MFDataset works well in reading NetCDF3 files, but it > appears that it doesn't work at present for NetCDF4 files. > > It works on my side for netCDF4 files. What

Re: [Numpy-discussion] [SciPy-dev] Deprecate chararray [was Plea for help]

2009-09-25 Thread Michael Droettboom
David Goldsmith wrote: > On Tue, Sep 22, 2009 at 4:02 PM, Ralf Gommers > mailto:ralf.gomm...@googlemail.com>> wrote: > > > On Tue, Sep 22, 2009 at 1:58 PM, Michael Droettboom > mailto:md...@stsci.edu>> wrote: > > Trac has these bugs. Any others? > > http://projects.scipy.o

[Numpy-discussion] MFDatasets and NetCDF4

2009-09-25 Thread George Nurser
Hi, I hope this is the right place to ask this. I've found the MFDataset works well in reading NetCDF3 files, but it appears that it doesn't work at present for NetCDF4 files. Is this an inherent problem with the NetCDF4 file structure, or would it be possible to implement the MFDataset for NetCDF

Re: [Numpy-discussion] np.any and np.all short-circuiting

2009-09-25 Thread David Cournapeau
On Fri, Sep 25, 2009 at 6:50 PM, Citi, Luca wrote: > Thanks for your reply. > So, what is the correct way to test a numpy development version without > installing it in /usr/lib/... or /usr/local/lib/.. ? > What do you guys do? Build in place, but test from outside the source tree. I for example

Re: [Numpy-discussion] np.any and np.all short-circuiting

2009-09-25 Thread Citi, Luca
Thanks for your reply. So, what is the correct way to test a numpy development version without installing it in /usr/lib/... or /usr/local/lib/.. ? What do you guys do? ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/ma

Re: [Numpy-discussion] datetime functionality: questions and requests

2009-09-25 Thread Charles R Harris
On Fri, Sep 25, 2009 at 1:06 AM, David Cournapeau < da...@ar.media.kyoto-u.ac.jp> wrote: > Hi there, Hi Travis, > >I have started looking at the new datetime code, with the idea that > we should soon fix (for real) a release date for numpy 1.4.0. I have a > few requests and questions: >- s

[Numpy-discussion] datetime functionality: questions and requests

2009-09-25 Thread David Cournapeau
Hi there, Hi Travis, I have started looking at the new datetime code, with the idea that we should soon fix (for real) a release date for numpy 1.4.0. I have a few requests and questions: - since npy_datetime is conditionally defined to be 64 bits, why not typedefing it to npy_int64 ?