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: Bill B. <wb...@gm...> - 2006-02-17 05:58:49
|
Quaternions using which convention? [s,x,y,z] or [x,y,z,w]? The docstring should make it very clear. Perhaps support a flag for choosing which, unless there's some python-wide standard for quaternions that I'm not aware of. --Bill On 2/17/06, Charles R Harris <cha...@gm...> wrote: > > Would anyone be interested in a quaternion version of this for nx4 > arrays with nx3 as a special case where the scalar part =3D=3D 0? Looking > at the the cross product implementation, it shouldn't be to hard to > duplicate this for quaternions. What should such a product be called? > Something like qprod? > > Chuck > > |
|
From: Charles R H. <cha...@gm...> - 2006-02-17 05:44:38
|
Hi Travis, I notice that the fromfile function in NumPy no longer accepts the shape keyword that the numarray version has. The functionalitiy can be duplicated by reshaping the array after creating it, but I think the shape keyword is a bit more convenient for that. Thoughts? Chuck |
|
From: Charles R H. <cha...@gm...> - 2006-02-17 05:40:51
|
Would anyone be interested in a quaternion version of this for nx4 arrays with nx3 as a special case where the scalar part =3D=3D 0? Looking at the the cross product implementation, it shouldn't be to hard to duplicate this for quaternions. What should such a product be called? Something like qprod? Chuck |
|
From: Robert K. <rob...@gm...> - 2006-02-17 05:32:59
|
I just realized today that for some reason I haven't actually been subscribed to this list since the end of September. Apparently, I've only been getting mails addressed to numpy-discussion if they were CC'ed to one of the scipy lists or to me personally. This was just enough traffic to fool me into thinking I was still subscribed. I wondered why you guys were so quiet. To the people whom I redirected here from comp.lang.python and then (seemingly) ignored, I'm sorry! -- Robert Kern rob...@gm... "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter |
|
From: Bill B. <wb...@gm...> - 2006-02-17 03:35:29
|
Howdy,
On 2/17/06, Brian Blais <bb...@br...> wrote:
>
> Colin J. Williams wrote:
> > Brian Blais wrote:
> >> In my attempt to learn python, migrating from matlab, I have the
> >> following problem. Here is what I want to do, (with the wrong syntax):
> >>
> >> from numpy import *
> >>
> >> t=3Darange(0,20,.1)
> >> x=3Dzeros(len(t),'f')
This was the line causing the type error. t is type double (float64). 'f'
makes x be type float32. That causes the assignment below to fail.
Replacing that line with
x=3Dzeros(len(t),'d')
should work. Or the zeros_like() that Travis suggested.
>>
> >> idx=3D(t>5) # <---this produces a Boolean array, probab=
ly
> not what you want.
> >> tau=3D5
> >> x[idx]=3Dexp(-t[idx]/tau) # <---this line is wrong (gives a TypeError=
)
> >>
You could also use
idx=3Dwhere(t>5)
In place of
idx=3D(t>5)
Although in this case it probably doesn't make much difference, where(expr)
is more directly equivalent to matlab's find(expr).
See http://www.scipy.org/Wiki/NumPy_for_Matlab_Users for more Matlab
equivalents. And consider contributing your own, if you have some good one=
s
that aren't there already.
--bb
|
|
From: Ian H. <har...@gm...> - 2006-02-17 03:20:42
|
On 2/15/06, Travis Oliphant <oli...@ie...> wrote: > Ian Harrison wrote: > > >Hello, > > > >I have two groups of 3x1 arrays that are arranged into two larger 3xn > >arrays. Each of the 3x1 sub-arrays represents a vector in 3D space. In > >Matlab, I'd use the function cross() to calculate the cross product of > >the corresponding 'vectors' from each array. In other words: > > > > > > > Help on function cross in module numpy.core.numeric: > > cross(a, b, axisa=3D-1, axisb=3D-1, axisc=3D-1) > Return the cross product of two (arrays of) vectors. > > The cross product is performed over the last axis of a and b by defau= lt, > and can handle axes with dimensions 2 and 3. For a dimension of 2, > the z-component of the equivalent three-dimensional cross product is > returned. > > It's the axisa, axisb, and axisc that you are interested in. > > The default is to assume you have Nx3 arrays and return an Nx3 array. > But you can change the axis used to find vectors. > > cross(A,B,axisa=3D0,axisb=3D0,axisc=3D0) > > will do what you want. I suppose, a single axis=3D argument might be > useful as well for the common situation of having all the other axis > arguments be the same. > > -Travis Travis, Thanks for your patience. This is what I was looking for. Ian |
|
From: Sasha <nd...@ma...> - 2006-02-17 03:16:00
|
You should make t and x the same type: either add dtype=3D'f' to arange or change dtype=3D'f' to dtype=3D'd' in zeros. On 2/16/06, Brian Blais <bb...@br...> wrote: > Hello, > > In my attempt to learn python, migrating from matlab, I have the followin= g problem. > Here is what I want to do, (with the wrong syntax): > > from numpy import * > > t=3Darange(0,20,.1) > x=3Dzeros(len(t),'f') > > idx=3Dwhere(t>5) > tau=3D5 > x[idx]=3Dexp(-t[idx]/tau) # <---this line is wrong (gives a TypeError) > > #------------------ > > what is the best way to replace the wrong line with something that works:= replace all > of the values of x at the indices idx with exp(-t/tau) for values of t at= indices idx? > > I do this all the time in matlab scripts, but I don't know that the pytho= nic > preferred method is. > > > > thanks, > > bb > > > -- > ----------------- > > bb...@br... > http://web.bryant.edu/~bblais > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
|
From: Ryan K. <rya...@gm...> - 2006-02-17 03:15:55
|
Brian's example works fine for me as long as x=3Dzeros(len(t),'d') for some reason the error seems to come from assignment of a double array to a single precision array: In [318]: x=3Dzeros(len(t),'f') In [319]: t=3Darange(0,20,.1) In [320]: idx=3Dwhere(t>5) In [321]: x[idx]=3Dexp(-t[idx]/tau) --------------------------------------------------------------------------- exceptions.TypeError Traceback (most recent call last) /home/ryan/thesis/accuracy/<ipython console> TypeError: array cannot be safely cast to required type In [322]: x=3Dzeros(len(t),'d') In [323]: x[idx]=3Dexp(-t[idx]/tau) In [324]: Ryan On 2/16/06, Travis Oliphant <oli...@ie...> wrote: > Brian Blais wrote: > > > Colin J. Williams wrote: > > > >> Brian Blais wrote: > >> > >>> In my attempt to learn python, migrating from matlab, I have the > >>> following problem. Here is what I want to do, (with the wrong syntax)= : > >>> > >>> from numpy import * > >>> > >>> t=3Darange(0,20,.1) > >>> x=3Dzeros(len(t),'f') > >>> > >>> idx=3D(t>5) # <---this produces a Boolean array, > >>> probably not what you want. > >>> tau=3D5 > >>> x[idx]=3Dexp(-t[idx]/tau) # <---this line is wrong (gives a TypeErro= r) > >>> > >> What are you trying to do? It is most unlikely that you need Boolean > >> values in x[idx] > >> > > > > in this example, as in many that I would do in matlab, I want to > > replace part of a vector with values from another vector. In this > > case, I want x to be zero from t=3D0 to 5, and then have a value of > > exp(-t/tau) for t>5. I could do it with an explicit for-loop, but > > that would be both inefficient and unpython-like. For those who know > > matlab, what I am doing here is: > > > from numpy import * > > > t =3D r_[0:20:0.1] > idx =3D t>5 > tau =3D 5 > x =3D zeros_like(t) > x[idx] =3D exp(-t[idx]/tau) > > > Should do it. > > -Travis > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion > |
|
From: Travis O. <oli...@ie...> - 2006-02-17 03:01:33
|
Brian Blais wrote: > Colin J. Williams wrote: > >> Brian Blais wrote: >> >>> In my attempt to learn python, migrating from matlab, I have the >>> following problem. Here is what I want to do, (with the wrong syntax): >>> >>> from numpy import * >>> >>> t=arange(0,20,.1) >>> x=zeros(len(t),'f') >>> >>> idx=(t>5) # <---this produces a Boolean array, >>> probably not what you want. >>> tau=5 >>> x[idx]=exp(-t[idx]/tau) # <---this line is wrong (gives a TypeError) >>> >> What are you trying to do? It is most unlikely that you need Boolean >> values in x[idx] >> > > in this example, as in many that I would do in matlab, I want to > replace part of a vector with values from another vector. In this > case, I want x to be zero from t=0 to 5, and then have a value of > exp(-t/tau) for t>5. I could do it with an explicit for-loop, but > that would be both inefficient and unpython-like. For those who know > matlab, what I am doing here is: > from numpy import * t = r_[0:20:0.1] idx = t>5 tau = 5 x = zeros_like(t) x[idx] = exp(-t[idx]/tau) Should do it. -Travis |
|
From: Brian B. <bb...@br...> - 2006-02-17 02:46:16
|
Colin J. Williams wrote:
> Brian Blais wrote:
>> In my attempt to learn python, migrating from matlab, I have the
>> following problem. Here is what I want to do, (with the wrong syntax):
>>
>> from numpy import *
>>
>> t=arange(0,20,.1)
>> x=zeros(len(t),'f')
>>
>> idx=(t>5) # <---this produces a Boolean array, probably not what you want.
>> tau=5
>> x[idx]=exp(-t[idx]/tau) # <---this line is wrong (gives a TypeError)
>>
> What are you trying to do? It is most unlikely that you need Boolean
> values in x[idx]
>
in this example, as in many that I would do in matlab, I want to replace part of a
vector with values from another vector. In this case, I want x to be zero from t=0
to 5, and then have a value of exp(-t/tau) for t>5. I could do it with an explicit
for-loop, but that would be both inefficient and unpython-like. For those who know
matlab, what I am doing here is:
t=0:.1:20;
idx=find(t>5);
tau=5;
x=zeros(size(t));
x(idx)=exp(-t(idx)/tau)
is that clearer? I am sure there is a nice method to do this in python, but I
haven't found it in the python or numpy docs.
thanks,
bb
--
-----------------
bb...@br...
http://web.bryant.edu/~bblais
|
|
From: Brian B. <bb...@br...> - 2006-02-17 02:40:08
|
Hello,
In my attempt to learn python, migrating from matlab, I have the following problem.
Here is what I want to do, (with the wrong syntax):
from numpy import *
t=arange(0,20,.1)
x=zeros(len(t),'f')
idx=where(t>5)
tau=5
x[idx]=exp(-t[idx]/tau) # <---this line is wrong (gives a TypeError)
#------------------
what is the best way to replace the wrong line with something that works: replace all
of the values of x at the indices idx with exp(-t/tau) for values of t at indices idx?
I do this all the time in matlab scripts, but I don't know that the pythonic
preferred method is.
thanks,
bb
--
-----------------
bb...@br...
http://web.bryant.edu/~bblais
|
|
From: Travis O. <oli...@ie...> - 2006-02-17 00:10:41
|
I'm pleased to announce the release of NumPy 0.9.5 The release notes and download site can be found at http://www.scipy.org Best regards, -Travis Oliphant |
|
From: Gary R. <gr...@bi...> - 2006-02-16 23:00:28
|
Thanks Travis, I think this is what Ian was asking for (axis=1 rather than axis=0). I was confused by your previous reply in this thread which I blindly followed without thinking about it. <snip> >(there is a single axis argument available now in SVN which means > axisa=axisb=axisc=axis) Nice addition. Gary R. |
|
From: Stefan v. d. W. <st...@su...> - 2006-02-16 21:54:23
|
On Thu, Feb 16, 2006 at 02:06:15PM -0700, Travis Oliphant wrote:
> Stefan van der Walt wrote:
>=20
> >Is there any way to control the underlying storage for a record?
> >
> >I am trying to use Travis' earlier example of an image with named fiel=
ds:
> >
> >dt =3D N.dtype('<f12', [('r','<f4'),('g','<f4'),('b','<f4')])
> >img =3D N.array(N.empty((rows,columns)), dtype=3Ddt)
> >
> >Using this, I can access the different bands of the image using
> >
> >img['r'], img['g'], img['b'] (but not img.r as mentioned in some of
> >the posts).
> >=20
> >
> Attribute lookup (img.r) is the purpose of the record array subclass.
>=20
> rimg=3D img.view(numpy.recarray)
>=20
> rimg.r --- will now work.
Thanks for the quick response! This is very useful information.
Regards
St=E9fan
|
|
From: Travis O. <oli...@ie...> - 2006-02-16 21:50:33
|
Sasha wrote:
>I was looking at the code implementing array_new in arrayobject.c and
>for a while I could not convince myself that it handles ref. counts
>correctly. The cleanup code (at the "fail:" label contains
>Py_XDECREF(descr), meaning that descr is unreferenced on failure
>unless it is NULL. This makes sense because descr is created inside
>array_new by PyArray_DescrConverter, but if the failure is detected
>in PyArg_ParseTupleAndKeywords, descr may be NULL. What was
>puzzling to me, failures of PyArray_NewFromDescr are handled by "if
>(ret == NULL) {descr=NULL;goto fail;}" that sets descr to NULL before
>jumping to cleanup. As I investigated further, I've discovered the
>following helpful comment preceding PyArray_NewFromDescr : /* steals a
>reference to descr (even on failure) */ that explains why descr=NULL
>is necessary.
>
>I wonder what was the motivation for this design choice. I don't
>think this is a natural behavior for python C-API functions. I am not
>proposing to make any changes, just curious about the design.
>
>
The PyArray_Descr structure never used to be a Python object. Now it is.
There is the C-API PyArray_DescrFromType that used to just return a
C-structure but now it returns a reference-counted Python object.
People are not used to reference counting the PyArray_Descr objects.
The easiest way to make this work in my mind was to have the functions
that use the Descr object steal a reference because ultimately the Descr
objects purpose is to reside in an array. It is created for the
purpose of being a member of an array structure which therefore steals
it's reference.
As an example, with this design you can write (and there are macros that
do).
PyArray_NewFromDescr(...., PyArray_DescrFromType(type_num), ....)
and not create reference-count leaks.
-Travis
|
|
From: Sasha <nd...@ma...> - 2006-02-16 21:41:23
|
I was looking at the code implementing array_new in arrayobject.c and
for a while I could not convince myself that it handles ref. counts
correctly. The cleanup code (at the "fail:" label contains=20
Py_XDECREF(descr), meaning that descr is unreferenced on failure
unless it is NULL. This makes sense because descr is created inside
array_new by PyArray_DescrConverter, but if the failure is detected
in PyArg_ParseTupleAndKeywords, descr may be NULL. What was
puzzling to me, failures of PyArray_NewFromDescr are handled by "if
(ret =3D=3D NULL) {descr=3DNULL;goto fail;}" that sets descr to NULL before
jumping to cleanup. As I investigated further, I've discovered the
following helpful comment preceding PyArray_NewFromDescr : /* steals a
reference to descr (even on failure) */ that explains why descr=3DNULL
is necessary.
I wonder what was the motivation for this design choice. I don't
think this is a natural behavior for python C-API functions. I am not
proposing to make any changes, just curious about the design.
|
|
From: Travis O. <oli...@ie...> - 2006-02-16 21:06:26
|
Stefan van der Walt wrote:
>Is there any way to control the underlying storage for a record?
>
>I am trying to use Travis' earlier example of an image with named fields:
>
>dt = N.dtype('<f12', [('r','<f4'),('g','<f4'),('b','<f4')])
>img = N.array(N.empty((rows,columns)), dtype=dt)
>
>Using this, I can access the different bands of the image using
>
>img['r'], img['g'], img['b'] (but not img.r as mentioned in some of
>the posts).
>
>
Attribute lookup (img.r) is the purpose of the record array subclass.
rimg= img.view(numpy.recarray)
rimg.r --- will now work.
>'img' itself is a matrix of similar dimension as img['r'], but
>contains the combined items of type '<f12'.
>
>
Be-ware that the '<f12' data-type (based on the C long double) is not
available on all platforms ---
and on some platforms long double is '<f16' (there is no '<f12'). It's
implementation specific.
>However, I would like to store the image as a 3xMxN array, with the r,
>g and b bands being contained in
>
>img[0], img[1] and img[2]
>
>
You don't need a record array to do that. Just define your array as a
3xMxN array of floats.
But, you could just re-define the data-type as
img2 = img.view(('f4',3)) -- if img is MxN then img2 is MxNx3.
or use rimg.field(0) --- field was recently added to record-arrays.
>Is there a way to construct the record so that this structure is used
>for storage? Further, how do I specify the dtype above, i.e.
>
>N.dtype('<f12', [('r','<f4'),('g','<f4'),('b','<f4')])
>
>in the style
>
>N.dtype({'names' : ['r','g','b'], 'formats': ['f4','f4','f4']})
>
>
>
>(how do I specify that the combined type is 'f12')?
>
>
Use a tuple
N.dtype(('<f12', {'names' : ['r','g','b'], 'formats': ['f4','f4','f4']}))
-Travis
|
|
From: Stefan v. d. W. <st...@su...> - 2006-02-16 19:26:19
|
Is there any way to control the underlying storage for a record?
I am trying to use Travis' earlier example of an image with named fields:
dt =3D N.dtype('<f12', [('r','<f4'),('g','<f4'),('b','<f4')])
img =3D N.array(N.empty((rows,columns)), dtype=3Ddt)
Using this, I can access the different bands of the image using
img['r'], img['g'], img['b'] (but not img.r as mentioned in some of
the posts).
'img' itself is a matrix of similar dimension as img['r'], but
contains the combined items of type '<f12'.
However, I would like to store the image as a 3xMxN array, with the r,
g and b bands being contained in
img[0], img[1] and img[2]
Is there a way to construct the record so that this structure is used
for storage? Further, how do I specify the dtype above, i.e.
N.dtype('<f12', [('r','<f4'),('g','<f4'),('b','<f4')])
in the style
N.dtype({'names' : ['r','g','b'], 'formats': ['f4','f4','f4']})
(how do I specify that the combined type is 'f12')?
I tried to find some documentation on record arrays, but couldn't find
anything. Any pointers appreciated!
Cheers
St=E9fan
|
|
From: Travis N. V. <tr...@en...> - 2006-02-16 19:17:19
|
Enthought is pleased to announce the release of Python Enthought Edition Version 0.9.2 (http://code.enthought.com/enthon/) -- a python distribution for Windows. This is a kitchen-sink-included Python distribution including the following packages/tools out of the box: Numeric 24.2 SciPy 0.3.3 IPython 0.6.15 Enthought Tool Suite 1.0.2 wxPython 2.6.1.0 PIL 1.1.4 mingw 20030504-1 f2py 2.45.241_1926 MayaVi 1.5 Scientific Python 2.4.5 VTK 4.4 and many more... 0.9.2 Release Notes Summary --------------------------- Version 0.9.2 of Python Enthought Edition is the first to include the Enthought Tool Suite Package (http://code.enthought.com/ets/). Other changes include upgrading to Numeric 24.2, including MayaVi 1.5 (rather than 1.3) and removing a standalone PyCrust package in favor of the one included with wxPython. Also, elementtree and celementtree have been added to the distribution. Notably, this release is still based on Python 2.3.5 and still includes SciPy 0.3.3. You'll also notice that we have changed the version numbering to a major.minor.point format (from a build number format). see full release notes at: http://code.enthought.com/release/changelog-enthon0.9.2.shtml Best, Travis N. Vaught |
|
From: Travis O. <oli...@ie...> - 2006-02-16 14:20:35
|
Gary Ruben wrote: > I expect to get from this > > In [21]: a=array([[[1],[2],[3]],[[4],[5],[6]],[[7],[8],[9]]]) > In [22]: b=array([[[1],[2],[4]],[[4],[5],[7]],[[7],[8],[10]]]) > > the solution > > Out[24]: > array([[[ 2], > [-1], > [ 0]], > > [[ 5], > [-4], > [ 0]], > > [[ 8], > [-7], > [ 0]]]) Why do you expect to get this solution with axis=0? Remember axis=0 thinks the vectors are formed in the 0th dimension. Thus a[:,0,0] and a[:,1,0] and a[:,2,0] are the vectors you are using. You appear to be thinking of the vectors in the axis=1 dimension where the vectors would be a[0,:,0], a[1,:,0], a[2,:,0] But this is specified with axis=1 (there is a single axis argument available now in SVN which means axisa=axisb=axisc=axis) Thus, cross(a,b,axis=1) Gives the solution I think you are after. -Travis |
|
From: Arnd B. <arn...@we...> - 2006-02-16 12:38:11
|
Hi Chris, On Wed, 15 Feb 2006, Christopher Barker wrote: > Arnd Baecker wrote: > > - we need scipy.xplt > > (matplotlib is still no option at this point) > > Why not? just curious. That's a slightly longer story, but since you asked ;-): First, I should emphasize that I really think that matplotlib is extremely good, the quality of the plots is superb! Also it is used a lot in our group for research. However, in our opinion we cannot use matplotlib for our course for the following two main reasons (a) some (for us crucial) bugs (b) speed Concerning (a), the most crucial problem is the double-buffering problem. This did not exist with matplotlib 0.82 and has been reported several times, the last one being http://sourceforge.net/mailarchive/forum.php?thread_id=9559204&forum_id=33405 The presently suggested work-around is to use TkAgg as backend. However, the TkAgg backend is slower than any other backend. We cannot tell our students to use TkAgg for one problem and switch to WXAgg for another problem - they already struggle enough with learning python (there are several first-time-programmers as well) and the hard physics problems we give them ;-). To us this double-buffering problem is the show-stopper number one. Unfortunately, I don't understand the internals of matplotlib well enough to help with tracking this one down. There are a couple of further problems which we reported, but have fallen through the cracks - no complaint, that's how things are. But it is (from our point of view) not worth talking about them again as long as the double-buffering problem is still there. On the speed side (b): we have been using scipy.xplt and even that (though generally considered to be really fast) is not as fast as for example pgplot ;-). In addition many of our students run older maschines starting from PIIIs (I think the PIIs are gone by now, but two years ago quite a few still used them). So this is something to be kept in mind when talking about speed. We hired a student to do the conversion of our exercises from scipy.xplt to matplotlib and look into some of the speed issues. With John Hunters help this got pretty far, http://sourceforge.net/mailarchive/forum.php?thread_id=8153459&forum_id=33405 http://sourceforge.net/mailarchive/forum.php?thread_id=8185639&forum_id=33405 http://sourceforge.net/mailarchive/forum.php?thread_id=8243168&forum_id=33405 http://sourceforge.net/mailarchive/forum.php?thread_id=8346924&forum_id=33405 http://sourceforge.net/mailarchive/forum.php?thread_id=8498518&forum_id=33405 http://sourceforge.net/mailarchive/forum.php?thread_id=8728580&forum_id=33405 I think that there was no further message after this and the whole approach has not yet been incorporated into MPL. To me it made the impression that it was very close to a good solution, and I would be willing to take up this issue again if there is a chance that it gets integrated into MPL. So, presumably many of the speed issues could be resolved The price to be paid is in some cases a factor of two more lines of code for the plotting (compared to scipy.xplt). By using a bit more encapsulation, this could surely be overcome. Ok, I hope I could roughly explain why we think that we cannot yet use Matplotlib - it is really almost there, so I remain very optimistic that at least next year we will be using it as the default plotting environment. Best, Arnd |
|
From: Francesc A. <fa...@ca...> - 2006-02-16 10:56:55
|
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D Announcing PyTables 1.2.2 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D This is a maintenance version. Some important improvements and bug fixes has been addressed in it. Go to the PyTables web site for downloading the beast: http://pytables.sourceforge.net/ or keep reading for more info about the new features and bugs fixed in this version. Changes more in depth =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Improvements: =2D Multidimensional arrays of strings are now supported as node attributes. They just need to be wrapped into ``CharArray`` objects (see the ``numarray.strings`` module). =2D The limit of 512 KB for row sizes in tables has been removed. Now, there is no limit in the row size. =2D When using table row iterators in non-iterator contexts, a warning is issued recommending the users to use them in iterator contexts. Before, when these iterators were used, it was printed a regular record get from an arbitrary place of the memory, giving a non-sense record as a result. =2D Compression libraries are now dynamically loaded as different extension modules, so there is no longer need for producing several binary packages supporting different sets of compressors. Bug fixes: =2D Solved a leak that exposed when reading VLArray data. The problem was due to the usage of different heaps (C and Python) of memory. Thanks to Russel Howe to report this and to provide an initial patch. Known issues: =2D Time datatypes are non-portable between big-endian and little-endian architectures. This is ultimately a consequence of an HDF5 limitation. See SF bug #1234709 for more info. Backward-incompatible changes: =2D Please, see RELEASE-NOTES.txt file. Important notes for Windows users =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D If you are willing to use PyTables with Python 2.4 in Windows platforms, you will need to get the HDF5 library compiled for MSVC 7.1, aka .NET 2003. It can be found at: ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/bin/windows/5-165-win-net.ZIP Users of Python 2.3 on Windows will have to download the version of HDF5 compiled with MSVC 6.0 available in: ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current/bin/windows/5-165-win.ZIP Also, note that support for the UCL compressor has not been added in the binary build of PyTables for Windows because of memory problems (perhaps some bad interaction between UCL and something else). Eventually, UCL support might be dropped in the future, so, please, refrain to create datasets compressed with it. What it is =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D **PyTables** is a package for managing hierarchical datasets and designed to efficiently cope with extremely large amounts of data (with support for full 64-bit file addressing). It features an object-oriented interface that, combined with C extensions for the performance-critical parts of the code, makes it a very easy-to-use tool for high performance data storage and retrieval. PyTables runs on top of the HDF5 library and numarray (Numeric is also supported and NumPy support is coming along) package for achieving maximum throughput and convenient use. Besides, PyTables I/O for table objects is buffered, implemented in C and carefully tuned so that you can reach much better performance with PyTables than with your own home-grown wrappings to the HDF5 library. PyTables sports indexing capabilities as well, allowing doing selections in tables exceeding one billion of rows in just seconds. Platforms =3D=3D=3D=3D=3D=3D=3D=3D=3D This version has been extensively checked on quite a few platforms, like Linux on Intel32 (Pentium), Win on Intel32 (Pentium), Linux on Intel64 (Itanium2), FreeBSD on AMD64 (Opteron), Linux on PowerPC and MacOSX on PowerPC. For other platforms, chances are that the code can be easily compiled and run without further issues. Please, contact us in case you are experiencing problems. Resources =3D=3D=3D=3D=3D=3D=3D=3D=3D Go to the PyTables web site for more details: http://pytables.sourceforge.net/ About the HDF5 library: http://hdf.ncsa.uiuc.edu/HDF5/ About numarray: http://www.stsci.edu/resources/software_hardware/numarray To know more about the company behind the PyTables development, see: http://www.carabos.com/ Acknowledgments =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Thanks to various the users who provided feature improvements, patches, bug reports, support and suggestions. See THANKS file in distribution package for a (incomplete) list of contributors. Many thanks also to SourceForge who have helped to make and distribute this package! And last but not least, a big thank you to THG (http://www.hdfgroup.org/) for sponsoring many of the new features recently introduced in PyTables. Share your experience =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Let us know of any bugs, suggestions, gripes, kudos, etc. you may have. =2D--- **Enjoy data!** -- The PyTables Team =2D-=20 >0,0< Francesc Altet =A0 =A0 http://www.carabos.com/ V V C=E1rabos Coop. V. =A0=A0Enjoy Data "-" |
|
From: Pearu P. <pe...@sc...> - 2006-02-16 10:31:53
|
On Wed, 15 Feb 2006, Francesc Altet wrote: > A Dimecres 15 Febrer 2006 11:18, Pearu Peterson va escriure: >> On Wed, 15 Feb 2006, Francesc Altet wrote: >>> I've been trying to see how to correctly load the unicode tests, but >>> failed miserably. Perhaps Pearu can tell us about the correct way to >>> do that. >> >> I have fixed it in svn. When importing modules from tests/ directory, one >> must surround the corresponding import statements with set_local_path() >> and restore_path() calls. > > Ah, ok. Is there any place where this is explained or we have to use > the source to figure out these sort of things? There is a single note about set_local_path in numpy/doc/DISTUTILS.txt. I agree that it would be nice to have Howtos such as "Howto write scipy-styled setup.py" "Howto write scipy-styled unit tests" etc Pearu |
|
From: Arnd B. <arn...@we...> - 2006-02-16 09:46:27
|
Hi, On Wed, 15 Feb 2006, Travis Oliphant wrote: > Arnd Baecker wrote: > > >Reasons not to switch > >- there is no enthought edition yet (right?) > >- there are only packages for a few platforms/distribution > >- we need scipy.xplt > > (matplotlib is still no option at this point) > > > >Discussion/Background: > > > >To us the two main show-stoppers are scipy.xplt and the question > >about an Enthought Edition for Windows. > >For the Pool of PCs where the tutorial groups are to be held, > >it won't be a problem to install numpy/scipy in such > >a way that scipy.sandbox.xplt is visible as scipy.xplt > >(at least I hope). > >However, the students will either have windows (around 80%) > >or Linux at home. For windows users we have used > >the Enthought Edition (http://code.enthought.com/enthon/) > >and linux users were pointed to > >available packages for their machines or to install Numeric/scipy > >themselves. > > > As long as there are binaries for all the packages. Just having a list > of Windows installers can also work. > Were you using all of what is in > the Enthon edition? Of course not (there is so much stuff ;-), but the students made good use of VPython and also VTK/MayaVi was well recieved. So the bare minimum might be python+numpy/scipy/ipython/Vpython (+any windows specific stuff?) + maybe VTK and MayaVi > >Concerning xplt another option might be to > >install scipy.sandbox.xplt in such a way > >that a `import xplt` would work. If that is possible we could > >try to supply `xplt` separately for some of the distributions, > >and maybe also for windows (which I don't use, so I have > >no idea how difficult that would be). > > > > > I don't think that would be hard at all. You can just run python > setup.py bdist_inst from within the sandbox/xplt directory and get a > windows installer. OK, some in our group have much better knowledge about windows, so I will ask them to test this approach. > >If something like this was possible, the main question is > >whether a new enthon distribution with new numpy/scipy/ipython > >and all the other niceties of mayavi/VTK/wxPython/.... > >will come out in the near future? > > > I have no idea about that one. But, it sounds like the guy (Joe) at > Enthought who did most of the work on the Enthon distribution is no > longer as available for them, so I'm not sure... I see - could this somehow be turned into a community effort? Surely it is a non-trivial task - in particular the monolithic structure of an all-in-one download package seems to make upgrades of individual components difficult. Would something like some super-installer, calling the individual package installers be possible? (or does anything like a package management system for windows exist?) You see, I don't know anything about Windows, so I better shut up on this ;-). Many thanks, Arnd |
|
From: Gary R. <gr...@bi...> - 2006-02-16 08:59:58
|
Hi Travis,
Have you tested this? It appears to give the wrong answer on my system.
I expect to get from this
In [21]: a=array([[[1],[2],[3]],[[4],[5],[6]],[[7],[8],[9]]])
In [22]: b=array([[[1],[2],[4]],[[4],[5],[7]],[[7],[8],[10]]])
the solution
Out[24]:
array([[[ 2],
[-1],
[ 0]],
[[ 5],
[-4],
[ 0]],
[[ 8],
[-7],
[ 0]]])
i.e. the same as my example but with column vectors instead of rows, but
doing cross(a,b,axisa=0,axisb=0,axisc=0) gives
Out[15]:
array([[[ 0],
[ 0],
[-3]],
[[ 0],
[ 0],
[ 6]],
[[ 0],
[ 0],
[-3]]])
Gary R.
Travis Oliphant wrote:
> Ian Harrison wrote:
>
>> Hello,
>>
>> I have two groups of 3x1 arrays that are arranged into two larger 3xn
>> arrays. Each of the 3x1 sub-arrays represents a vector in 3D space. In
>> Matlab, I'd use the function cross() to calculate the cross product of
>> the corresponding 'vectors' from each array. In other words:
>>
>>
>
>
> Help on function cross in module numpy.core.numeric:
>
> cross(a, b, axisa=-1, axisb=-1, axisc=-1)
> Return the cross product of two (arrays of) vectors.
>
> The cross product is performed over the last axis of a and b by default,
> and can handle axes with dimensions 2 and 3. For a dimension of 2,
> the z-component of the equivalent three-dimensional cross product is
> returned.
>
> It's the axisa, axisb, and axisc that you are interested in.
>
> The default is to assume you have Nx3 arrays and return an Nx3 array.
> But you can change the axis used to find vectors.
>
> cross(A,B,axisa=0,axisb=0,axisc=0)
>
> will do what you want. I suppose, a single axis= argument might be
> useful as well for the common situation of having all the other axis
> arguments be the same.
>
> -Travis
|