numpy.numarray.alter_code1 | index /usr/lib/python2.6/dist-packages/numpy/numarray/alter_code1.py |
This module converts code written for numarray to run with numpy
Makes the following changes:
* Changes import statements
import numarray.package
--> import numpy.numarray.package as numarray_package
with all numarray.package in code changed to numarray_package
import numarray --> import numpy.numarray as numarray
import numarray.package as <yyy> --> import numpy.numarray.package as <yyy>
from numarray import <xxx> --> from numpy.numarray import <xxx>
from numarray.package import <xxx>
--> from numpy.numarray.package import <xxx>
package can be convolve, image, nd_image, mlab, linear_algebra, ma,
matrix, fft, random_array
* Makes search and replace changes to:
- .imaginary --> .imag
- .flat --> .ravel() (most of the time)
- .byteswapped() --> .byteswap(False)
- .byteswap() --> .byteswap(True)
- .info() --> numarray.info(self)
- .isaligned() --> .flags.aligned
- .isbyteswapped() --> (not .dtype.isnative)
- .typecode() --> .dtype.char
- .iscontiguous() --> .flags.contiguous
- .is_c_array() --> .flags.carray and .dtype.isnative
- .is_fortran_contiguous() --> .flags.fortran
- .is_f_array() --> .dtype.isnative and .flags.farray
- .itemsize() --> .itemsize
- .nelements() --> .size
- new(type) --> numarray.newobj(self, type)
- .repeat(r) --> .repeat(r, axis=0)
- .size() --> .size
- type() -- numarray.typefrom(self)
- .typecode() --> .dtype.char
- .stddev() --> .std()
- .togglebyteorder() --> numarray.togglebyteorder(self)
- .getshape() --> .shape
- .setshape(obj) --> .shape=obj
- .getflat() --> .ravel()
- .getreal() --> .real
- .setreal() --> .real =
- .getimag() --> .imag
- .setimag() --> .imag =
- .getimaginary() --> .imag
- .setimaginary() --> .imag
Modules | ||||||
|
Functions | ||
|
Data | ||
__all__ = ['convertfile', 'convertall', 'converttree', 'convertsrc'] __file__ = '/usr/lib/python2.6/dist-packages/numpy/numarray/alter_code1.pyc' __name__ = 'numpy.numarray.alter_code1' __package__ = 'numpy.numarray' flatindex_re = <_sre.SRE_Pattern object at 0x70bb730> header_re = <_sre.SRE_Pattern object at 0x710d050> info_re = <_sre.SRE_Pattern object at 0x7100330> isbyte_re = <_sre.SRE_Pattern object at 0x710acc0> iscarr_re = <_sre.SRE_Pattern object at 0x7101710> isfarr_re = <_sre.SRE_Pattern object at 0x710b280> new_re = <_sre.SRE_Pattern object at 0x7101950> repeat_re = <_sre.SRE_Pattern object at 0x710b9e0> setimag_re = <_sre.SRE_Pattern object at 0x710cc70> setimaginary_re = <_sre.SRE_Pattern object at 0x710ca30> setreal_re = <_sre.SRE_Pattern object at 0x70ffed0> setshape_re = <_sre.SRE_Pattern object at 0x710b7a0> toggle_re = <_sre.SRE_Pattern object at 0x7101b30> type_re = <_sre.SRE_Pattern object at 0x710ab30> |