[Numpy-svn] r3158 - trunk/numpy/numarray

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Sep 15 11:59:20 CDT 2006


Author: oliphant
Date: 2006-09-15 11:59:14 -0500 (Fri, 15 Sep 2006)
New Revision: 3158

Modified:
   trunk/numpy/numarray/functions.py
   trunk/numpy/numarray/numerictypes.py
Log:
Fix numarray.info function

Modified: trunk/numpy/numarray/functions.py
===================================================================
--- trunk/numpy/numarray/functions.py	2006-09-14 23:40:52 UTC (rev 3157)
+++ trunk/numpy/numarray/functions.py	2006-09-15 16:59:14 UTC (rev 3158)
@@ -347,10 +347,10 @@
     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 @@
     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):

Modified: trunk/numpy/numarray/numerictypes.py
===================================================================
--- trunk/numpy/numarray/numerictypes.py	2006-09-14 23:40:52 UTC (rev 3157)
+++ trunk/numpy/numarray/numerictypes.py	2006-09-15 16:59:14 UTC (rev 3158)
@@ -530,6 +530,23 @@
 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]
 



More information about the Numpy-svn mailing list