|
From: Francesc A. <fa...@ca...> - 2006-01-20 15:50:56
|
A Divendres 20 Gener 2006 16:42, Colin J. Williams va escriure:
> Travis Oliphant wrote:
> > I'd like to make a release of NumPy over the weekend. Please submit
> > bugs to the list before Saturday night (GMT -7)
> >
> > NumPy 0.9.2 was based on SVN version 1829 and we are over 100 checkins
> > from that point, including the significant change to the .dtype
> > attribute....
>
> Will there be some note with the release explaining this, or do we have
> to browse the discussion to get the detail?
Here you have the original explanation from Travis posted in this list
a couple of days ago:
=2D----------
There was some cruft left over from the change to making data-type=20
descriptors real Python objects. This left lots of .dtype related=20
attributes on the array object --- too many as Francesc Altet graciously=20
pointed out.
In the latest SVN, I've cleaned things up (thanks to a nice patch from=20
=46rancesc to get it started). Basically, there is now only one=20
attribute on the array object dealing with the data-type (arr.dtype). =20
This attribute returns the data-type descriptor object for the array. =20
This object itself has the attributes .char, .str, and .type (among=20
others).=20
I think this will lead to less confusion long term. The cruft was due=20
to the fact that my understanding of the data-type descriptor came in=20
December while seriously looking at records module.
This will have some backward-compatibility issues (we are still pre-1.0=20
and early enough that I hope this is not too difficult to deal with).
The compatibility to numpy-0.9.2 issues I can see are:
1) Replacing attributes that are now gone:
.dtypechar --> .dtype.char
.dtypestr --> .dtype.str
.dtypedescr --> .dtype
2) Changing old .dtype -> .dtype.type
This is only necessary if you were using a.dtype as a *typeobject*=20
as in
issubclass(a.dtype, <some scalar type>)
If you were using .dtype as a parameter to dtype=3D then that usage=20
will still work
great (in fact a little faster) because now .dtype returns a=20
"descriptor object"
3) The dtypedescr constructor is now called dtype.
This change should have gone into the 0.9.2 release, but things got too=20
hectic with all the name changes. I will quickly release 0.9.4 with=20
these changes unless I hear strong disagreements within the next few days.
=2DTravis
P.S.
SciPy SVN has been updated and fixed with the changes.
Numeric compatibility now implies that .typecode() --> .dtype.char
although if .typecode() was used as an argument to a function, then=20
=2Edtype will very likely work.
=2DTravis
=2D-=20
>0,0< Francesc Altet =A0 =A0 http://www.carabos.com/
V V C=E1rabos Coop. V. =A0=A0Enjoy Data
"-"
|