You can subscribe to this list here.
2000 |
Jan
(8) |
Feb
(49) |
Mar
(48) |
Apr
(28) |
May
(37) |
Jun
(28) |
Jul
(16) |
Aug
(16) |
Sep
(44) |
Oct
(61) |
Nov
(31) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(56) |
Feb
(54) |
Mar
(41) |
Apr
(71) |
May
(48) |
Jun
(32) |
Jul
(53) |
Aug
(91) |
Sep
(56) |
Oct
(33) |
Nov
(81) |
Dec
(54) |
2002 |
Jan
(72) |
Feb
(37) |
Mar
(126) |
Apr
(62) |
May
(34) |
Jun
(124) |
Jul
(36) |
Aug
(34) |
Sep
(60) |
Oct
(37) |
Nov
(23) |
Dec
(104) |
2003 |
Jan
(110) |
Feb
(73) |
Mar
(42) |
Apr
(8) |
May
(76) |
Jun
(14) |
Jul
(52) |
Aug
(26) |
Sep
(108) |
Oct
(82) |
Nov
(89) |
Dec
(94) |
2004 |
Jan
(117) |
Feb
(86) |
Mar
(75) |
Apr
(55) |
May
(75) |
Jun
(160) |
Jul
(152) |
Aug
(86) |
Sep
(75) |
Oct
(134) |
Nov
(62) |
Dec
(60) |
2005 |
Jan
(187) |
Feb
(318) |
Mar
(296) |
Apr
(205) |
May
(84) |
Jun
(63) |
Jul
(122) |
Aug
(59) |
Sep
(66) |
Oct
(148) |
Nov
(120) |
Dec
(70) |
2006 |
Jan
(460) |
Feb
(683) |
Mar
(589) |
Apr
(559) |
May
(445) |
Jun
(712) |
Jul
(815) |
Aug
(663) |
Sep
(559) |
Oct
(930) |
Nov
(373) |
Dec
|
From: Kenny O. <kor...@id...> - 2006-10-17 18:35:37
|
just looking for some help, most of the time you guys are good with matlab code, i am trying to use the filter function under this setting y = filter(b,a,X) filters the data in vector X with the filter described by numerator coefficient vector b and denominator coefficient vector a. If a(1) is not equal to 1, filter normalizes the filter coefficients by a(1). If a(1) equals 0, filter returns an error. I pretty much have the same as the example, except my data array is different data = [1:0.2:4]'; windowSize = 5; filter(ones(1,windowSize)/windowSize,1,data) ans = 0.2000 0.4400 0.7200 1.0400 1.4000 1.6000 1.8000 2.0000 2.2000 2.4000 2.6000 2.8000 3.0000 3.2000 3.4000 3.6000 my question is does numpy/scipy have a function for this, if not the algorithm states y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb) - a(2)*y(n-1) - ... - a(na+1)*y(n-na)but a is a number not an arrayThanks for the help,~Kenny |
From: Charles R H. <cha...@gm...> - 2006-10-17 18:25:28
|
On 10/12/06, Cristian Codorean <cri...@gm...> wrote: > > Hello list, > I got some old code that uses Scientific and Numeric. Recently, these > two packages were updated to the latest versions together with python and my > code started failing. The first major problem I have is when downcasting. > Code that used to work now fails because the array cannot be safely cast > anymore to the required type. If anyone could help me please and direct me > to some documentation about when this change happened (version), why it > happened, is there any other solution but using astype, can numpy help me in > anyway in this situation, because I got really lost ... This seems related to a more recent thread. Travis says that numeric throwing an error on downcasting is traditional, so I am curious as to why the previous code should have worked. Chuck |
From: Andrew M. <And...@AB...> - 2006-10-17 18:15:45
|
Travis Oliphant wrote: >Andrew MacKeith wrote: > > > >>I would like to use the built-in array_repr in numpy, because >>I need a fast repr that does not contain new line characters. >>I see no way of doing this without editing the code in numeric.py, >>and I hate to edit other people's libraries. >> >> >> >>from numpy import array > > >>causes numeric.py to be executed, which includes a call to >>multiarray.set_string_function(array_repr, 1) >> >>If I want to "undo" this, there is no way of doing it. >> >> >> >> >Why do want to "undo" this? > > > >>I would like to unset the repr with: >>numpy.set_string_function(None, 1) >> >> >> >> >I don't understand what you are trying to do. Why don't you just set >the string function to an actual callable. > Since arrayobject.c contains a fast repr function, I would like to use that. Why reinvent the wheel. >What edits do you propose to >make? > > If you mean how would I propose to change the code, I would have array_set_string_function recognise None as an acceptable argument and PyArray_SetStringFunction would recognise this to set PyArray_ReprFunction = array_repr; These is the (untested) code. multiarraymodule.c: static PyObject * array_set_string_function(PyObject *dummy, PyObject *args, PyObject *kwds) { PyObject *op; int repr=1; static char *kwlist[] = {"f", "repr", NULL}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O|i", kwlist, &op, &repr)) return NULL; if (!PyCallable_Check(op) and op != Py_None) { PyErr_SetString(PyExc_TypeError, "Argument must be callable."); return NULL; } PyArray_SetStringFunction(op, repr); Py_INCREF(Py_None); return Py_None; } arrayobject.c: static void PyArray_SetStringFunction(PyObject *op, int repr) { if (repr) { /* Dispose of previous callback */ Py_XDECREF(PyArray_ReprFunction); if (op == Py_None) { PyArray_ReprFunction = array_repr; } else { /* Add a reference to new callback */ Py_XINCREF(op); /* Remember new callback */ PyArray_ReprFunction = op; } } else { /* Dispose of previous callback */ Py_XDECREF(PyArray_StrFunction); if (op == Py_None) { PyArray_StrFunction = array_str; } else { /* Add a reference to new callback */ Py_XINCREF(op); /* Remember new callback */ PyArray_StrFunction = op; } } } >-Travis > > > >------------------------------------------------------------------------- >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job easier >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >_______________________________________________ >Numpy-discussion mailing list >Num...@li... >https://lists.sourceforge.net/lists/listinfo/numpy-discussion > > > |
From: Lisandro D. <da...@gm...> - 2006-10-17 18:03:44
|
On 10/17/06, Travis Oliphant <oli...@ee...> wrote: > Or you can use the Python C-API > > const char *buffer; > Py_ssize_t buflen; > > PyObject_AsReadBuffer(scalar, (const void **)&buffer, &buflen) > > to retrieve a pointer to the data in buffer and the size of the data in > buflen. > Travis. Have numpy something similar to a mutable scalar, or the only way is using an array whit only one element? --=20 Lisandro Dalc=EDn --------------- Centro Internacional de M=E9todos Computacionales en Ingenier=EDa (CIMEC) Instituto de Desarrollo Tecnol=F3gico para la Industria Qu=EDmica (INTEC) Consejo Nacional de Investigaciones Cient=EDficas y T=E9cnicas (CONICET) PTLC - G=FCemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 |
From: Lisandro D. <da...@gm...> - 2006-10-17 17:58:24
|
On 10/17/06, Travis Oliphant <oli...@ee...> wrote: > The require command can help you get the right kind of > array for that purpose. > BTW, Travis In [1]: numpy.__version__ Out[1]: '1.0rc2' In [2]: print numpy.require.__doc__ None What is this 'requirements' argument? What should user pass in?. I seen sorce code at numpy.core.numeric.require. It seems this functions expects an iterable producing string. I am right? --=20 Lisandro Dalc=EDn --------------- Centro Internacional de M=E9todos Computacionales en Ingenier=EDa (CIMEC) Instituto de Desarrollo Tecnol=F3gico para la Industria Qu=EDmica (INTEC) Consejo Nacional de Investigaciones Cient=EDficas y T=E9cnicas (CONICET) PTLC - G=FCemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 |
From: Travis O. <oli...@ee...> - 2006-10-17 17:46:24
|
Andrew MacKeith wrote: >I would like to use the built-in array_repr in numpy, because >I need a fast repr that does not contain new line characters. >I see no way of doing this without editing the code in numeric.py, >and I hate to edit other people's libraries. > >from numpy import array >causes numeric.py to be executed, which includes a call to >multiarray.set_string_function(array_repr, 1) > >If I want to "undo" this, there is no way of doing it. > > Why do want to "undo" this? >I would like to unset the repr with: >numpy.set_string_function(None, 1) > > I don't understand what you are trying to do. Why don't you just set the string function to an actual callable. What edits do you propose to make? -Travis |
From: Charles R H. <cha...@gm...> - 2006-10-17 17:37:20
|
On 10/17/06, Travis Oliphant <oli...@ee...> wrote: > > Travis Oliphant wrote: > > >Charles R Harris wrote: > > <snip> >The long-standing behavior is to raise the error on possible-loss > >conversion and so my opinion is that we should continue with that > behavior. > > > > > > > But, on the other hand, it looks like numarray went the other direction > and allows a cast using the array call. > > Thus > > import numarray > a = numarray.array([1,2,3],'d') > numarray.array(a, 'f') > > works > > > So, I'm willing to go with the numarray behavior in numpy. > > Thanks for the change, Travis. I'll wait a bit to make sure the API remains stable and then do some cleanups in linalg. Correctness before optimization and all that. I did note that the LaPack interface could throw an error at the fortran level that would issue an informative error message and dump me out of python. Is there anyway you know of to trap this behaviour? Chuck |
From: Andrew M. <And...@AB...> - 2006-10-17 17:28:21
|
I would like to use the built-in array_repr in numpy, because I need a fast repr that does not contain new line characters. I see no way of doing this without editing the code in numeric.py, and I hate to edit other people's libraries. from numpy import array causes numeric.py to be executed, which includes a call to multiarray.set_string_function(array_repr, 1) If I want to "undo" this, there is no way of doing it. I would like to unset the repr with: numpy.set_string_function(None, 1) but this raises a TypeError because None is not callable. This behavior was the same in Numeric, and in that case I edited the code in Numeric.py but it would be nice if I didn't have to do that. Should I submit a patch for this? Andrew MacKeith |
From: Travis O. <oli...@ee...> - 2006-10-17 17:13:32
|
Travis Oliphant wrote: >Charles R Harris wrote: > > >>It seems to me that since the behaviour when copy=0 is to make a copy >>only if necessary, it should find it necessary and make the downcast. >>After all, array(a, dtype=single, copy=1) does just that without >>complaint. Some common code in linalg could be replaced if array and >>asarray would do that operation. >> >> >> >Well, the fact that it makes the copy without raising an error is >different behavior from Numeric and should be considered an unintended >change. > >We definitely should make this consistent for copy=0 or copy=1. The >only question, is do we raise the error in both cases or allow the >conversion in both cases. > >The long-standing behavior is to raise the error on possible-loss >conversion and so my opinion is that we should continue with that behavior. > > > But, on the other hand, it looks like numarray went the other direction and allows a cast using the array call. Thus import numarray a = numarray.array([1,2,3],'d') numarray.array(a, 'f') works So, I'm willing to go with the numarray behavior in numpy. -Travis |
From: Travis O. <oli...@ee...> - 2006-10-17 17:01:26
|
Stefan van der Walt wrote: >On Tue, Oct 17, 2006 at 10:01:51AM -0600, Travis Oliphant wrote: > > >>Charles R Harris wrote: >> >> >> >>>Travis, >>> >>>I note that >>> >>> >>> >>>>>>a = arange(6).reshape(2,3,order='F') >>>>>>a >>>>>> >>>>>> >>>array([[0, 1, 2], >>> [3, 4, 5]]) >>> >>>Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making a >>>copy, but flat, flatten, and tostring all show the elements in 'C' >>>order. I ask because I wonder if changing the order can be used to >>>prepare arrays for input into the LaPack routines. >>> >>> >>The order argument to reshape means (how should the big-chunk of data be >>interpreted when you reshape). So, yes, this should be >>[[0,2,4],[1,3,5]]. It is a bug that it does not do the right thing in >>this case. >> >> > >A bit counter-ituitive (I somehow expect reshape to return an array >that satisfies all the constraints specified as parameters -- i.e. >shape and order in memory), but consistent with Numeric. > > Perhaps, but that is not what reshape does. When you are reshaping an array, unless you are just adding ones to the shape somewhere or aren't actually changing the shape, then you are implicitly thinking about the array as a 1-d chunk of memory in some order. The default is C-order. The order argument let's you think about it differently. >What confuses me is that, if you call the array constructor, you get > >In [2]: N.array(N.array([[1,2,3],[4,5,6]]),order='F') >Out[2]: >array([[1, 2, 3], > [4, 5, 6]]) > >so here 'order' means something else. > > Not really. I can't imagine what else you would expect here. You have specified the array explicitly. The order argument only specifies how the array will be arranged in memory. It is an implementation detail. The user is allowed some control in order to interface to compiled code more effectively. >So then you do > >x = N.array([[0,1,2],[3,4,5]],order='F') >x.reshape((2,3),order='C') > >and you get > >array([[0, 1, 2], > [3, 4, 5]]) > > > I don't see the problem. The first line gives you an array: [[0,1,2], [3,4,5]] which in memory is laid out as [0,3,1,4,2,5] The second line says reshape into a (2,3) array but this is exactly the same shape as the input array so in fact only a new view of the same data is given to you. The fact that you specify order is inconsequential since you aren't really changing the shape, it doesn't matter. The reshape command is not intended to alter the underlying ordering of an input array. The ordering of an array is an implementation detail that shouldn't matter to the user unless you are trying to interface to compiled code. The require command can help you get the right kind of array for that purpose. In general, arrays can have arbitrary strides. C-order and Fortran-order are just two special cases of that generality. So, you cannot think of any array as just being either in C-order or Fortran-order. -Travis |
From: Stefan v. d. W. <st...@su...> - 2006-10-17 16:44:31
|
On Tue, Oct 17, 2006 at 10:01:51AM -0600, Travis Oliphant wrote: > Charles R Harris wrote: >=20 > > Travis, > > > > I note that > > > > >>> a =3D arange(6).reshape(2,3,order=3D'F') > > >>> a > > array([[0, 1, 2], > > [3, 4, 5]]) > > > > Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making = a=20 > > copy, but flat, flatten, and tostring all show the elements in 'C'=20 > > order. I ask because I wonder if changing the order can be used to=20 > > prepare arrays for input into the LaPack routines. >=20 >=20 > The order argument to reshape means (how should the big-chunk of data b= e=20 > interpreted when you reshape). So, yes, this should be=20 > [[0,2,4],[1,3,5]]. It is a bug that it does not do the right thing in=20 > this case. A bit counter-ituitive (I somehow expect reshape to return an array that satisfies all the constraints specified as parameters -- i.e. shape and order in memory), but consistent with Numeric. What confuses me is that, if you call the array constructor, you get In [2]: N.array(N.array([[1,2,3],[4,5,6]]),order=3D'F') Out[2]:=20 array([[1, 2, 3], [4, 5, 6]]) so here 'order' means something else. So then you do x =3D N.array([[0,1,2],[3,4,5]],order=3D'F') x.reshape((2,3),order=3D'C') and you get array([[0, 1, 2], [3, 4, 5]]) Hmm. Cheers St=E9fan |
From: Francesc A. <fa...@ca...> - 2006-10-17 16:36:13
|
A Dimarts 17 Octubre 2006 18:22, Travis Oliphant va escriure: > >2.- Fetch the buffer in scalartype.data and use the buffer protocol in > > order to access the pointer to data in memory. However, I lack experien= ce > > in buffer protocol, so suggestions for achieving this are welcome. > > This will also work. A read-only buffer protocol is exported by all > the scalars. > > scalar.data will return a buffer object. > > Or you can use the Python C-API > > const char *buffer; > Py_ssize_t buflen; > > PyObject_AsReadBuffer(scalar, (const void **)&buffer, &buflen) Oh, this one seems pretty easy, and as a plus, you don't have to book memor= y=20 for copying the data area, so I'll use it. Thanks, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Travis O. <oli...@ee...> - 2006-10-17 16:22:21
|
Francesc Altet wrote: >Hi, > >I'm looking for an easy way to access the data area of the numpy scalars no >matter its type. I've seen that numpy/arrayscalars.h define a structure for >each scalar type, so I'd guess that it will not be possible to find a general >way for accessing the data buffer for each type. So, I've decided to look for >a workaround and I've devised a couple of possibilities: > > This problem showed up in writing NumPy several times. One solution might be to use PyArray_ScalarAsCtype(PyObject *scalar, void *ctypeptr) which will copy the data into the area pointed to by ctypeptr (unless you have a "flexible scalar" in which case only a pointer to the data-area will be copied). >2.- Fetch the buffer in scalartype.data and use the buffer protocol in order >to access the pointer to data in memory. However, I lack experience in buffer >protocol, so suggestions for achieving this are welcome. > > This will also work. A read-only buffer protocol is exported by all the scalars. scalar.data will return a buffer object. Or you can use the Python C-API const char *buffer; Py_ssize_t buflen; PyObject_AsReadBuffer(scalar, (const void **)&buffer, &buflen) to retrieve a pointer to the data in buffer and the size of the data in buflen. -Travis |
From: Francesc A. <fa...@ca...> - 2006-10-17 16:07:38
|
Hi, I'm looking for an easy way to access the data area of the numpy scalars no= =20 matter its type. I've seen that numpy/arrayscalars.h define a structure fo= r=20 each scalar type, so I'd guess that it will not be possible to find a gener= al=20 way for accessing the data buffer for each type. So, I've decided to look f= or=20 a workaround and I've devised a couple of possibilities: 1.- Promote the scalar type to a ndarray object and use the regular ndarray= C=20 structure to access the data buffer. 2.- Fetch the buffer in scalartype.data and use the buffer protocol in orde= r=20 to access the pointer to data in memory. However, I lack experience in buff= er=20 protocol, so suggestions for achieving this are welcome. If there is some other trivial way that I haven't devised (specially if usa= ble=20 from pyrex), please tell me about. TIA, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Travis O. <oli...@ee...> - 2006-10-17 16:02:09
|
Charles R Harris wrote: > Travis, > > I note that > > >>> a = arange(6).reshape(2,3,order='F') > >>> a > array([[0, 1, 2], > [3, 4, 5]]) > > Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making a > copy, but flat, flatten, and tostring all show the elements in 'C' > order. I ask because I wonder if changing the order can be used to > prepare arrays for input into the LaPack routines. The order argument to reshape means (how should the big-chunk of data be interpreted when you reshape). So, yes, this should be [[0,2,4],[1,3,5]]. It is a bug that it does not do the right thing in this case. I've committed a fix to SVN and a test for this case. -Travis |
From: gary t. <ga...@bm...> - 2006-10-17 15:00:39
|
what is the best and most efficiednt way to deal with hyper complex numbers in numpy/scipy e.g. for a 1d array we have a complex number containing real and imaginary pairs... conceptually we have ((r,i),(r,i)...(r,i)) however, for a hypercomplex number in 2d we have quartets of numbers e.g. ((rr,ir,ir,ii),rr,ir,ir,ii)....), ((rr,ir,ir,ii),rr,ir,ir,ii)....), . . . ((rr,ir,ir,ii),rr,ir,ir,ii)....), or planes of complex numbers r. ((r,i),(r,i)...(r,i)), ((r,i),(r,i)...(r,i)), . . . ((r,i),(r,i)...(r,i)) i. ((r,i),(r,i)...(r,i)), ((r,i),(r,i)...(r,i)), . . . ((r,i),(r,i)...(r,i)) that is the best way to deal with these in scipy/numpy especially with respect to 2D fourier transforms and data processing regards gary |
From: Jeff S. <js...@en...> - 2006-10-17 12:20:46
|
This was a problem in Virtualmin when I created the mpi4py virtual server. I reverted the change, and everything seems to work now. Sorry for the inconvenience, Jeff On Monday 16 October 2006 10:14 pm, Robert Kern wrote: > Charles R Harris wrote: > > Subversion seems to be down. I get the following message: > > > > Authentication realm: <http://svn.scipy.org:80> mpi4py.scipy.org > > <http://mpi4py.scipy.org> > > > > mpi4py? And I am asked for my password, which doesn't work. Scipy.org > > <http://Scipy.org> also seems to be down. You folks having trouble there? > > Apparently. I've contacted Jeff Strunk, the sysadmin. |
From: <pe...@ce...> - 2006-10-17 11:04:22
|
On Tue, 17 Oct 2006, Stefan van der Walt wrote: > On Tue, Oct 17, 2006 at 10:03:03AM +0200, Francesc Altet wrote: > > A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: > > > On 10/13/06, Francesc Altet <fa...@ca...> wrote: > > > > Is it possible to test a numpy version directly from the source > > > > directory without having to install it? > > > > > > I usually do: > > > > > > $ python setup.py build > > > $ python setup.py install --home=/tmp > > > $ export PYTHONPATH=/tmp/lib/python > > > > Thanks for your answer Lisandro, but what I want is to completely avoid an > > installation. The idea is to be able to test the local copy version of numpy > > in the development directory while doing small changes on it. Having to do > > the install step slows down the testing phase when doing small > > changes. > > It would be great if we could get this to work. One problem is that > distutils won't build the C-modules in place. Does anyone know of a > workaround? Actually numpy.distutils supports in place builds of C modules. However, its rather difficult to make numpy inplace to work for the following reasons: - to build a numpy based C extension, you'll need numpy header files - numpy header files are generated during numpy build So it is a chicken-egg problem. One workaround for testing a numpy subpackage would be installing numpy and then doing inplace build in numpy subpackage directory. For example: cd svn/numpy python setup.py install cd numpy/fft python setup.py build build_ext --inplace Another workaround would be to install only numpy.core (that contains numpy headers) and then doing inplace builds in numpy source directory --- this, however, requires some setup.py modifications. IMO, doing inplace builds has side effects that can easily lead to shooting to a leg. While developing numpy, I would recommend always installing numpy to some place, setting PYTHONPATH accordingly, write unittests, and run them for testing. When test_*.py files are set up properly then you don't need to install everytime you modify unittests, they can be run inplace. Pearu |
From: Stefan v. d. W. <st...@su...> - 2006-10-17 08:47:25
|
On Mon, Oct 16, 2006 at 02:20:04PM -0600, Charles R Harris wrote: > Travis, >=20 > I note that >=20 > >>> a =3D arange(6).reshape(2,3,order=3D'F') > >>> a > array([[0, 1, 2], > [3, 4, 5]]) >=20 > Shouldn't that be 3x2? Or maybe [[0,2,4],[1,3,5]]? Reshape is making a = copy, > but flat, flatten, and tostring all show the elements in 'C' order. I a= sk > because I wonder if changing the order can be used to prepare arrays fo= r input > into the LaPack routines. I think that the calculation of 'a' above is correct, but that the memory representation is incorrect. For example (see attached script -- which is overkill, I know), these commands: x =3D N.arange(6,dtype=3Dfloat).reshape((2,3),order=3D'F') catmem(x) x =3D N.array([[0,1,2],[3,4,5]],order=3D'F',dtype=3Dfloat) catmem(x) x =3D N.array(N.arange(6,dtype=3Dfloat).reshape((2,3)),order=3D'F') catmem(x) x =3D N.asfortranarray(N.arange(6,dtype=3Dfloat).reshape((2,3))) catmem(x) yield the following results: 0.000000 1.000000 2.000000 3.000000 4.000000 5.000000=20 0.000000 3.000000 1.000000 4.000000 2.000000 5.000000=20 0.000000 3.000000 1.000000 4.000000 2.000000 5.000000=20 0.000000 3.000000 1.000000 4.000000 2.000000 5.000000=20 Regards St=E9fan |
From: Stefan v. d. W. <st...@su...> - 2006-10-17 08:22:36
|
On Tue, Oct 17, 2006 at 10:03:03AM +0200, Francesc Altet wrote: > A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: > > On 10/13/06, Francesc Altet <fa...@ca...> wrote: > > > Is it possible to test a numpy version directly from the source > > > directory without having to install it? > > > > I usually do: > > > > $ python setup.py build > > $ python setup.py install --home=3D/tmp > > $ export PYTHONPATH=3D/tmp/lib/python >=20 > Thanks for your answer Lisandro, but what I want is to completely avoid= an=20 > installation. The idea is to be able to test the local copy version of = numpy=20 > in the development directory while doing small changes on it. Having to= do=20 > the install step slows down the testing phase when doing small > changes. It would be great if we could get this to work. One problem is that distutils won't build the C-modules in place. Does anyone know of a workaround? At the moment, if you run numpy from the source directory, you see the message In [1]: import numpy Running from numpy source directory. after which you can't access any of the numpy functions. This would be due to this snippet in __init__.py: try: from __config__ import show as show_config except ImportError: show_config =3D None if show_config is None: import sys as _sys print >> _sys.stderr, 'Running from numpy source directory.' del _sys If we declare set_package_path and restore_path in __init__.py, we can wrap all imports in numpy with set_package_path('../../..') # set path back required depth from numpy import whatever, you, need restore_path() That would take care of things on the python side, at least. Cheers St=E9fan |
From: Francesc A. <fa...@ca...> - 2006-10-17 08:03:25
|
A Divendres 13 Octubre 2006 22:20, Lisandro Dalcin va escriure: > On 10/13/06, Francesc Altet <fa...@ca...> wrote: > > Is it possible to test a numpy version directly from the source > > directory without having to install it? > > I usually do: > > $ python setup.py build > $ python setup.py install --home=3D/tmp > $ export PYTHONPATH=3D/tmp/lib/python Thanks for your answer Lisandro, but what I want is to completely avoid an= =20 installation. The idea is to be able to test the local copy version of nump= y=20 in the development directory while doing small changes on it. Having to do= =20 the install step slows down the testing phase when doing small changes. Cheers, =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
From: Robert K. <rob...@gm...> - 2006-10-17 03:15:13
|
Charles R Harris wrote: > Subversion seems to be down. I get the following message: > > Authentication realm: <http://svn.scipy.org:80> mpi4py.scipy.org > <http://mpi4py.scipy.org> > > mpi4py? And I am asked for my password, which doesn't work. Scipy.org > <http://Scipy.org> also seems to be down. You folks having trouble there? Apparently. I've contacted Jeff Strunk, the sysadmin. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |
From: Charles R H. <cha...@gm...> - 2006-10-17 02:53:45
|
Subversion seems to be down. I get the following message: Authentication realm: <http://svn.scipy.org:80> mpi4py.scipy.org mpi4py? And I am asked for my password, which doesn't work. Scipy.org also seems to be down. You folks having trouble there? Chuck |
From: Pierre GM <pgm...@ma...> - 2006-10-17 02:43:11
|
On Monday 16 October 2006 22:08, Michael Sorich wrote: > Does this new MA class allow masking of rearray like arrays? Excellent question! Which is to say, I have no idea... I don't use recordarray, so I didn't think about testing them. So, a first test indicates that it doesn't work either. The mask for a3 is understood as having a size 6, when the data is seen as size 2 only (exactly the same problem as the original ma module). I gonna poke around and check whether I can come with a workaround. Just to make it clear: you want to be able to mask some fields in some records, right ? Not mask all the fields of a record ? Thanks for the feedback, I'll keep you posted. |
From: Michael S. <mic...@gm...> - 2006-10-17 02:08:53
|
Does this new MA class allow masking of rearray like arrays? The numpy (1.0b5) version does not seem to. e.g. from numpy import * desc = [('name','S30'),('age',int8),('weight',float32)] a = array([('Bill',31,260.0),('Fred', 15, 145.0)], dtype=desc) print a[0] print a['name'] a2 = ma.array([('Bill',31,260.0),('Fred', 15, 145.0)], dtype=desc, mask=ma.nomask) print a2[0] print a2['name'] a3 = ma.array([('Bill',31,260.0),('Fred', 15, 145.0)], dtype=desc, mask=[[True,False,False],[False,False, False]]) print a3[0] print a3['name'] -- output ('Bill', 31, 260.0) [Bill Fred] ('Bill', 31, 260.0) [Bill Fred] Traceback (most recent call last): File "D:\eclipse\Table\scripts\testrecarray.py", line 12, in ? a3 = ma.array([('Bill',31,260.0),('Fred', 15, 145.0)], dtype=desc, mask=[[True,False,False],[False,False, False]]) File "C:\Python23\Lib\site-packages\numpy\core\ma.py", line 592, in __init__ raise MAError, "Mask and data not compatible." numpy.core.ma.MAError: Mask and data not compatible. On 10/16/06, Pierre GM <pgm...@ma...> wrote: > Folks, > I just posted on the scipy/developers zone wiki > (http://projects.scipy.org/scipy/numpy/wiki/MaskedArray) a reimplementation > of the masked_array mopdule, motivated by some problems I ran into while > subclassing MaskedArray. > > The main differences with the initial numpy.core.ma package are that > MaskedArray is now a subclass of ndarray and that the _data section can now > be any subclass of ndarray (well, it should work in most cases, some tweaking > might required here and there). Apart from a couple of issues listed below, > the behavior of the new MaskedArray class reproduces the old one. It is quite > likely to be significantly slower, though: I was more interested in a clear > organization than in performance, so I tended to use wrappers liberally. I'm > sure we can improve that rather easily. > > The new module, along with a test suite and some utilities, are available > here: > http://projects.scipy.org/scipy/numpy/attachment/wiki/MaskedArray/maskedarray.py > http://projects.scipy.org/scipy/numpy/attachment/wiki/MaskedArray/masked_testutils.py > http://projects.scipy.org/scipy/numpy/attachment/wiki/MaskedArray/test_maskedarray.py > > Please note that it's still a work in progress (even if it seems to work quite > OK when I use it). Suggestions, comments, improvements and general feedback > are more than welcome ! > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |