diff options
author | Jarrod Millman <millman@berkeley.edu> | 2007-10-29 14:58:18 +0000 |
---|---|---|
committer | Jarrod Millman <millman@berkeley.edu> | 2007-10-29 14:58:18 +0000 |
commit | 0b77f0e5f0e46b2ef7c570ebda046c34bbcc0f26 (patch) | |
tree | c7609a2a685fd5bff235d812b8c5705621216f4c /numpy/core | |
parent | aa3c27cce3d0625f719b812c9e6b0aa73114c612 (diff) | |
download | numpy-0b77f0e5f0e46b2ef7c570ebda046c34bbcc0f26.tar.gz |
ran reindent.py to clean up whitespace
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/memmap.py | 3 | ||||
-rw-r--r-- | numpy/core/numeric.py | 20 | ||||
-rw-r--r-- | numpy/core/records.py | 2 | ||||
-rw-r--r-- | numpy/core/setup.py | 1 | ||||
-rw-r--r-- | numpy/core/tests/test_numeric.py | 10 |
5 files changed, 17 insertions, 19 deletions
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py index 1b007c957..56a44ba9c 100644 --- a/numpy/core/memmap.py +++ b/numpy/core/memmap.py @@ -100,5 +100,4 @@ class memmap(ndarray): try: self.close() except ValueError: - pass - + pass diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 4c3047720..59d2169d0 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -658,8 +658,8 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, dtype - the data-type of the resulting array. If this is a record data-type, the the resulting array will be 1-d and each row will be interpreted as an element of the array. The number of columns - used must match the number of fields in the data-type in this case. - + used must match the number of fields in the data-type in this case. + comments - the character used to indicate the start of a comment in the file @@ -699,21 +699,21 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, dtype = multiarray.dtype(dtype) defconv = _getconv(dtype) - converterseq = None + converterseq = None if converters is None: converters = {} if dtype.names is not None: converterseq = [_getconv(dtype.fields[name][0]) \ for name in dtype.names] - + for i,line in enumerate(fh): if i<skiprows: continue line = line[:line.find(comments)].strip() if not len(line): continue vals = line.split(delimiter) if converterseq is None: - converterseq = [converters.get(j,defconv) \ - for j in xrange(len(vals))] + converterseq = [converters.get(j,defconv) \ + for j in xrange(len(vals))] if usecols is not None: row = [converterseq[j](vals[j]) for j in usecols] else: @@ -730,7 +730,7 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, converters=None, else: return X -# adjust so that fmt can change across columns if desired. +# adjust so that fmt can change across columns if desired. def savetxt(fname, X, fmt='%.18e',delimiter=' '): """ @@ -776,7 +776,7 @@ def savetxt(fname, X, fmt='%.18e',delimiter=' '): X.shape = origShape - + @@ -894,10 +894,10 @@ def seterr(all=None, divide=None, over=None, under=None, invalid=None): >>> seterr(over='raise') # doctest: +SKIP {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'} - + >>> seterr(all='warn', over='raise') # doctest: +SKIP {'over': 'raise', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'} - + >>> int16(32000) * int16(3) # doctest: +SKIP Traceback (most recent call last): File "<stdin>", line 1, in ? diff --git a/numpy/core/records.py b/numpy/core/records.py index ed5b55408..b86a71d7b 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -375,7 +375,7 @@ def fromrecords(recList, dtype=None, shape=None, formats=None, names=None, >>> r.col1 array([456, 2]) >>> r.col2 - chararray(['dbe', 'de'], + chararray(['dbe', 'de'], dtype='|S3') >>> import cPickle >>> print cPickle.loads(cPickle.dumps(r)) diff --git a/numpy/core/setup.py b/numpy/core/setup.py index de70b8703..a8fd46911 100644 --- a/numpy/core/setup.py +++ b/numpy/core/setup.py @@ -345,4 +345,3 @@ int main(int argc, char **argv) if __name__=='__main__': from numpy.distutils.core import setup setup(configuration=configuration) - diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py index 891bf3be7..2f85c664e 100644 --- a/numpy/core/tests/test_numeric.py +++ b/numpy/core/tests/test_numeric.py @@ -275,13 +275,13 @@ class TestClip(NumpyTestCase): # use slow-clip selector = less(a, m)+2*greater(a, M) return selector.choose((a, m, M), out=out) - + # Handy functions def _generate_data(self, n, m): return randn(n, m) def _generate_data_complex(self, n, m): - return randn(n, m) + 1.j *rand(n, m) + return randn(n, m) + 1.j *rand(n, m) def _generate_flt_data(self, n, m): return (randn(n, m)).astype(float32) @@ -320,7 +320,7 @@ class TestClip(NumpyTestCase): def test_simple_int(self): """Test native int input with scalar min/max.""" a = self._generate_int_data(self.nr, self.nc) - a = a.astype(int) + a = a.astype(int) m = -2 M = 4 ac = self.fastclip(a, m, M) @@ -484,7 +484,7 @@ class TestClip(NumpyTestCase): def test_type_cast_02(self): "Test native int32 input with int32 scalar min/max." a = self._generate_int_data(self.nr, self.nc) - a = a.astype(int32) + a = a.astype(int32) m = -2 M = 4 ac = self.fastclip(a, m, M) @@ -507,7 +507,7 @@ class TestClip(NumpyTestCase): M = float32(4) act = self.fastclip(a,m,M) ac = self.clip(a,m,M) - assert_array_strict_equal(ac, act) + assert_array_strict_equal(ac, act) def test_type_cast_04(self): "Test native int32 with double arrays min/max." |