summaryrefslogtreecommitdiff
path: root/numpy/numarray
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-09-15 16:59:14 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-09-15 16:59:14 +0000
commitac9c4730ca4650d9cc1ca97323a1b499dab970b1 (patch)
treeb21d2f5fd46cb773c3a12c23f85dbb624b713ad0 /numpy/numarray
parent2259299c824b866df8c1ddcf2f7f6ba14930abbd (diff)
downloadnumpy-ac9c4730ca4650d9cc1ca97323a1b499dab970b1.tar.gz
Fix numarray.info function
Diffstat (limited to 'numpy/numarray')
-rw-r--r--numpy/numarray/functions.py8
-rw-r--r--numpy/numarray/numerictypes.py17
2 files changed, 21 insertions, 4 deletions
diff --git a/numpy/numarray/functions.py b/numpy/numarray/functions.py
index 55922e9fe..fb1c597ac 100644
--- a/numpy/numarray/functions.py
+++ b/numpy/numarray/functions.py
@@ -347,10 +347,10 @@ def info(obj):
print "byteoffset: 0"
print "bytestride: ", obj.strides[0]
print "itemsize: ", obj.itemsize
- print "aligned: ", obj.flags.isaligned
+ print "aligned: ", obj.flags.aligned
print "contiguous: ", obj.flags.contiguous
- print "buffer: ", obj.data
- print "data pointer:", obj._as_paramater_, "(DEBUG ONLY)"
+ print "buffer: ", repr(obj.data)
+ print "data pointer:", obj.ctypes._as_parameter_, "(DEBUG ONLY)"
print "byteorder: ",
endian = obj.dtype.byteorder
if endian in ['|','=']:
@@ -360,7 +360,7 @@ def info(obj):
else:
print "little"
print "byteswap: ", not obj.dtype.isnative
- print "type: ", typefrom(obj)
+ print "type: ", typefrom(obj).name
#clipmode is ignored if axis is not 0 and array is not 1d
def put(array, indices, values, axis=0, clipmode=RAISE):
diff --git a/numpy/numarray/numerictypes.py b/numpy/numarray/numerictypes.py
index eadaaeee3..3b27871df 100644
--- a/numpy/numarray/numerictypes.py
+++ b/numpy/numarray/numerictypes.py
@@ -530,6 +530,23 @@ _scipy_dtypechar_inverse = {}
for key,value in _scipy_dtypechar.items():
_scipy_dtypechar_inverse[value] = key
+_val = numpy.int_(0).itemsize
+if _val == 8:
+ _scipy_dtypechar_inverse['l'] = Int64
+ _scipy_dtypechar_inverse['L'] = UInt64
+elif _val == 4:
+ _scipy_dtypechar_inverse['l'] = Int32
+ _scipy_dtypechar_inverse['L'] = UInt32
+
+del _val
+
+if LP64:
+ _scipy_dtypechar_inverse['p'] = Int64
+ _scipy_dtypechar_inverse['P'] = UInt64
+else:
+ _scipy_dtypechar_inverse['p'] = Int32
+ _scipy_dtypechar_inverse['P'] = UInt32
+
def typefrom(obj):
return _scipy_dtypechar_inverse[obj.dtype.char]