numpy.oldnumeric.alter_code1 | index /usr/lib/python2.6/dist-packages/numpy/oldnumeric/alter_code1.py |
This module converts code written for Numeric to run with numpy
Makes the following changes:
* Changes import statements (warns of use of from Numeric import *)
* Changes import statements (using numerix) ...
* Makes search and replace changes to:
- .typecode()
- .iscontiguous()
- .byteswapped()
- .itemsize()
- .toscalar()
* Converts .flat to .ravel() except for .flat = xxx or .flat[xxx]
* Replace xxx.spacesaver() with True
* Convert xx.savespace(?) to pass + ## xx.savespace(?)
* Converts uses of 'b' to 'B' in the typecode-position of
functions:
eye, tri (in position 4)
ones, zeros, identity, empty, array, asarray, arange,
fromstring, indices, array_constructor (in position 2)
and methods:
astype --- only argument
-- converts uses of '1', 's', 'w', and 'u' to
-- 'b', 'h', 'H', and 'I'
* Converts uses of type(...) is <type>
isinstance(..., <type>)
Modules | ||||||
|
Functions | ||
|
Data | ||
__all__ = ['convertfile', 'convertall', 'converttree', 'convertsrc'] __file__ = '/usr/lib/python2.6/dist-packages/numpy/oldnumeric/alter_code1.pyc' __name__ = 'numpy.oldnumeric.alter_code1' __package__ = 'numpy.oldnumeric' _astr = r'type\s*[(]([^)]*)[)]\s+(?:is|==)\s+(.*?ComplexType)' _chars = {'1': 'b', 's': 'h', 'u': 'I', 'w': 'H'} _func2 = ['ones', 'zeros', 'identity', 'fromstring', 'indices', 'empty', 'array', 'asarray', 'arange', 'array_constructor'] _func4 = ['eye', 'tri'] _meth1 = ['astype'] _types = ['float', 'int', 'complex', 'ArrayType', 'FloatType', 'IntType', 'ComplexType'] char = 'w' flatindex_re = <_sre.SRE_Pattern object at 0x7126260> func_re = {'arange': <_sre.SRE_Pattern object at 0x7182e70>, 'array': <_sre.SRE_Pattern object at 0x7054160>, 'array_constructor': <_sre.SRE_Pattern object at 0x7182ba0>, 'asarray': <_sre.SRE_Pattern object at 0x71829d0>, 'astype': <_sre.SRE_Pattern object at 0x7183970>, 'empty': <_sre.SRE_Pattern object at 0x7054430>, 'eye': <_sre.SRE_Pattern object at 0x71834b0>, 'fromstring': <_sre.SRE_Pattern object at 0x709cc60>, 'identity': <_sre.SRE_Pattern object at 0x7181360>, 'indices': <_sre.SRE_Pattern object at 0x70ba2f0>, ...} header_re = <_sre.SRE_Pattern object at 0x7197b80> istest_re = {'ArrayType': <_sre.SRE_Pattern object at 0x7195a50>, 'ComplexType': <_sre.SRE_Pattern object at 0x7197760>, 'FloatType': <_sre.SRE_Pattern object at 0x71963f0>, 'IntType': <_sre.SRE_Pattern object at 0x7196100>, 'complex': <_sre.SRE_Pattern object at 0x7195ca0>, 'float': <_sre.SRE_Pattern object at 0x7195600>, 'int': <_sre.SRE_Pattern object at 0x71953b0>} meth_re = {'1': <_sre.SRE_Pattern object at 0x7183b10>, 's': <_sre.SRE_Pattern object at 0x7183cb0>, 'u': <_sre.SRE_Pattern object at 0x71837c0>, 'w': <_sre.SRE_Pattern object at 0x7193c60>} name = 'ComplexType' svspc2 = <_sre.SRE_Pattern object at 0x7197530> svspc3 = <_sre.SRE_Pattern object at 0x7197350> |