summaryrefslogtreecommitdiff
path: root/numpy/numarray/alter_code1.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-08-05 20:24:55 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-08-05 20:24:55 +0000
commitdb349674856abc7b2652546e937c85dbbbebbf9c (patch)
treeb40f595ec04a36881459922d642a2b0267c8159c /numpy/numarray/alter_code1.py
parent0072bd2837bcc89928fcc58e8ede88edbe1dcccd (diff)
downloadnumpy-db349674856abc7b2652546e937c85dbbbebbf9c.tar.gz
Move source, info, and who to NumPy
Diffstat (limited to 'numpy/numarray/alter_code1.py')
-rw-r--r--numpy/numarray/alter_code1.py58
1 files changed, 39 insertions, 19 deletions
diff --git a/numpy/numarray/alter_code1.py b/numpy/numarray/alter_code1.py
index 72cc33acb..3fb1acd74 100644
--- a/numpy/numarray/alter_code1.py
+++ b/numpy/numarray/alter_code1.py
@@ -2,26 +2,46 @@
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) ...
+ * Changes import statements
+
+ Stubs for
+ convolve --> numarray.convolve
+ image --> numarray.image
+ nd_image --> numarray.nd_image
+
* 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
+ - .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
+ - self.new(None) --> emtpy_like(self)
+ - self.new(type) --> empty(self.shape, type)
+ - .repeat(r) --> .repeat(r, axis=0)
+ - .size() --> .size
+ - .type() -- numarray.type(self.dtype)
+ - .typecode() --> .dtype.char
+ - .stddev() --> .std()
+ - .togglebyteorder() --> self.dtype=self.dtype.newbyteorder()
+ - .getshape() --> .shape
+ - .setshape(obj) --> .shape=obj
+ - .getflat() --> .ravel()
+ - .getreal() --> .real
+ - .setreal() --> .real =
+ - .getimag() --> .imag
+ - .setimag() --> .imag =
+ - .getimaginary() --> .imag
+ - .setimaginary() --> .imag
+
"""
__all__ = ['fromfile', 'fromstr']