Colin J. Williams
cjw at sympatico.ca
Fri Apr 1 05:49:53 CST 2005
Travis Oliphant wrote:
> For the most part, it seems the array protocol is easy to agree on.
> The one difficulty is typestr.
> For what it's worth, here are my opinions on what has been said
> regarding the typestr.
> * Endian-ness should be included in the typestr --- it is how the data
> is viewed and an intrinsic part of the type as much as int, or float.
In most cases, endian-ness is associated with the machine being used,
rather than the data element. It seems to me that numarray's numeric
types provides a good model, which may need enhancing for records,
Numeric type objects:
Int8 Int16 Int32 Int64
UInt8 UInt16 UInt32 UInt64
Numeric type classes:
> * I like the fact that struct character codes are documented, but it
> is hard to remember.
This is the problem. numerictypes provides nmenonic names and, if one
uses an editor with autocompletion, a prompt from the editor. For those
interface to existing code, there could be a helper function:
def toType(eltType= 'i'): => an instance of NumericType
It should also be possible to derive the typeCode from the eltType,
numarray doesn't seem to provide this.
More information about the Numpy-discussion