diff options
| author | Travis Oliphant <oliphant@enthought.com> | 2005-09-29 22:29:00 +0000 |
|---|---|---|
| committer | Travis Oliphant <oliphant@enthought.com> | 2005-09-29 22:29:00 +0000 |
| commit | 615d81479b16a7b2c057fb0ce93c690f3ccd99f4 (patch) | |
| tree | 54fa5178b8e77ebfe709ffec7799e5bcdbe72bae | |
| parent | fe215b7e7eb14e84cfdfe3a5de4196746489f95d (diff) | |
| download | numpy-615d81479b16a7b2c057fb0ce93c690f3ccd99f4.tar.gz | |
Changed names from axxxxx to xxxx_ for types that shadow builtin types.
| -rw-r--r-- | scipy/base/getlimits.py | 8 | ||||
| -rw-r--r-- | scipy/base/numeric.py | 2 | ||||
| -rw-r--r-- | scipy/base/numerictypes.py | 56 | ||||
| -rw-r--r-- | scipy/base/twodim_base.py | 4 | ||||
| -rw-r--r-- | scipy/base/type_check.py | 4 |
5 files changed, 37 insertions, 37 deletions
diff --git a/scipy/base/getlimits.py b/scipy/base/getlimits.py index 6445e1b28..b7bda6ffd 100644 --- a/scipy/base/getlimits.py +++ b/scipy/base/getlimits.py @@ -16,7 +16,7 @@ def frz(a): _convert_to_float = { numeric.csingle: numeric.single, - numeric.acomplex: numeric.afloat, + numeric.complex_: numeric.float_, numeric.clongfloat: numeric.longfloat } @@ -29,9 +29,9 @@ class finfo(object): raise ValueError, "data type not inexact" if not issubclass(dtype, numeric.floating): dtype = _convert_to_float[dtype] - if dtype is numeric.afloat: + if dtype is numeric.float_: try: - self.machar = _machar_cache[numeric.afloat] + self.machar = _machar_cache[numeric.float_] except KeyError: self.machar = MachAr(lambda v:array([v],'d'), lambda v:frz(v.astype('i'))[0], @@ -39,7 +39,7 @@ class finfo(object): lambda v:'%24.16e' % array(frz(v)[0],'d'), 'scipy float precision floating point '\ 'number') - _machar_cache[numeric.afloat] = self.machar + _machar_cache[numeric.float_] = self.machar elif dtype is numeric.single: try: diff --git a/scipy/base/numeric.py b/scipy/base/numeric.py index d3d5470d1..f13148dcb 100644 --- a/scipy/base/numeric.py +++ b/scipy/base/numeric.py @@ -183,7 +183,7 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1): #Use numarray's printing function from arrayprint import array2string, get_printoptions, set_printoptions -_typelessdata = [aint, afloat, acomplex] +_typelessdata = [int_, float_, complex_] if issubclass(intc, int): _typelessdata.append(intc) diff --git a/scipy/base/numerictypes.py b/scipy/base/numerictypes.py index b52ea5926..5e7ce17b9 100644 --- a/scipy/base/numerictypes.py +++ b/scipy/base/numerictypes.py @@ -20,59 +20,59 @@ Exported symbols include: c-based names - abool + bool_ - aobject + object_ - void, astr, aunicode + void, str_, unicode_ byte, ubyte, short, ushort intc, uintc, intp, uintp, - aint, uint, + int_, uint, longlong, ulonglong, single, csingle, - afloat, acomplex, + float_, complex_, longfloat, clongfloat, As part of the type-hierarchy: xx -- is bit-width generic - abool + bool_ numeric integer signedinteger (intxx) byte short - aint + intc intp int0 - longint + int_ longlong unsignedinteger (uintxx) ubyte ushort - uint + uintc uintp uint0 - ulongint + uint_ ulonglong floating (floatxx) single - afloat (double) + float_ (double) longfloat complexfloating (complexxx) csingle - acomplex (cfloat, cdouble) + complex_ (cfloat, cdouble) clongfloat flexible character - astr (string) - aunicode + str_ (string) + unicode_ void - aobject + object_ $Id: numerictypes.py,v 1.17 2005/09/09 22:20:06 teoliphant Exp $ """ @@ -176,24 +176,24 @@ for a in _tocheck: # Rework the Python names (so that float and complex and int are consistent # with Python usage) # -acomplex = cdouble +complex_ = cdouble int0 = intp uint0 = uintp single = float csingle = cfloat -afloat = double +float_ = double intc = int uintc = uint -aint = long +int_ = long uint = ulong cfloat = cdouble longfloat = longdouble clongfloat = clongdouble -abool = bool -aunicode = unicode -astr = string -aobject = object +bool_ = bool +unicode_ = unicode +str_ = string +object_ = object object = pyobject unicode = pyunicode @@ -221,7 +221,7 @@ arraytypes = {'int': [], 'uint':[], 'float':[], 'complex':[], - 'others':[abool,aobject,string,aunicode,void]} + 'others':[bool_,object_,str_,unicode_,void]} _ibytes = [1,2,4,8,16,32,64] _fbytes = [2,4,8,10,12,16,32,64] @@ -276,15 +276,15 @@ def _python_type(t): if not isinstance(t, _types.TypeType): t = type(t) if t == _types.IntType: - return aint + return int_ elif t == _types.FloatType: - return afloat + return float_ elif t == _types.ComplexType: - return acomplex + return complex_ elif t == _types.StringType: - return astr + return str_ elif t == _types.UnicodeType: - return aunicode + return unicode_ elif t == _types.BufferType: return void else: diff --git a/scipy/base/twodim_base.py b/scipy/base/twodim_base.py index acb286c0f..925ea1898 100644 --- a/scipy/base/twodim_base.py +++ b/scipy/base/twodim_base.py @@ -40,7 +40,7 @@ def rot90(m, k=1): elif k == 2: return fliplr(flipud(m)) else: return fliplr(transpose(m)) # k==3 -def eye(N, M=None, k=0, dtype=aint): +def eye(N, M=None, k=0, dtype=int_): """ eye returns a N-by-M 2-d array where the k-th diagonal is all ones, and everything else is zeros. """ @@ -80,7 +80,7 @@ def diag(v, k=0): raise ValueError, "Input must be 1- or 2-d." -def tri(N, M=None, k=0, dtype=aint): +def tri(N, M=None, k=0, dtype=int_): """ returns a N-by-M array where all the diagonals starting from lower left corner up to the k-th are all ones. """ diff --git a/scipy/base/type_check.py b/scipy/base/type_check.py index 9807dde2c..3e4e6324c 100644 --- a/scipy/base/type_check.py +++ b/scipy/base/type_check.py @@ -41,11 +41,11 @@ def mintypecode(typechars,typeset='GDFgdf',default='d'): l.sort() return l[0][1] -def asfarray(a, dtype=_nx.afloat): +def asfarray(a, dtype=_nx.float_): """asfarray(a,dtype=None) returns a as a float array.""" dtype = _nx.obj2dtype(dtype) if not issubclass(dtype, _nx.inexact): - dtype = _nx.afloat + dtype = _nx.float_ a = asarray(a,dtype=dtype) return a |
