diff options
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/_datasource.py | 4 | ||||
-rw-r--r-- | numpy/lib/scimath.py | 6 | ||||
-rw-r--r-- | numpy/lib/tests/test_format.py | 6 | ||||
-rw-r--r-- | numpy/lib/ufunclike.py | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py index 3055bf47a..7e760b416 100644 --- a/numpy/lib/_datasource.py +++ b/numpy/lib/_datasource.py @@ -38,7 +38,7 @@ import os from shutil import rmtree # Using a class instead of a module-level dictionary -# to reduce the inital 'import numpy' overhead by +# to reduce the inital 'import numpy' overhead by # deferring the import of bz2 and gzip until needed # TODO: .zip support, .tar support? @@ -197,7 +197,7 @@ class DataSource (object): def _isurl(self, path): """Test if path is a net location. Tests the scheme and netloc.""" - + # We do this here to reduce the 'import numpy' initial import time. from urlparse import urlparse diff --git a/numpy/lib/scimath.py b/numpy/lib/scimath.py index ed04d1ce5..0d765fa20 100644 --- a/numpy/lib/scimath.py +++ b/numpy/lib/scimath.py @@ -198,15 +198,15 @@ def sqrt(x): As the numpy.sqrt, this returns the principal square root of x, which is what most people mean when they use square root; the principal square root - of x is not any number z such as z^2 = x. + of x is not any number z such as z^2 = x. For positive numbers, the principal square root is defined as the positive - number z such as z^2 = x. + number z such as z^2 = x. The principal square root of -1 is i, the principal square root of any negative number -x is defined a i * sqrt(x). For any non zero complex number, it is defined by using the following branch cut: x = r e^(i t) with - r > 0 and -pi < t <= pi. The principal square root is then + r > 0 and -pi < t <= pi. The principal square root is then sqrt(r) e^(i t/2). """ x = _fix_real_lt_zero(x) diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py index 073af3dac..35558400f 100644 --- a/numpy/lib/tests/test_format.py +++ b/numpy/lib/tests/test_format.py @@ -434,13 +434,13 @@ def test_memmap_roundtrip(): format.write_array(fp, arr) finally: fp.close() - + fortran_order = (arr.flags.f_contiguous and not arr.flags.c_contiguous) ma = format.open_memmap(mfn, mode='w+', dtype=arr.dtype, shape=arr.shape, fortran_order=fortran_order) ma[...] = arr del ma - + # Check that both of these files' contents are the same. fp = open(nfn, 'rb') normal_bytes = fp.read() @@ -449,7 +449,7 @@ def test_memmap_roundtrip(): memmap_bytes = fp.read() fp.close() yield assert_equal, normal_bytes, memmap_bytes - + # Check that reading the file using memmap works. ma = format.open_memmap(nfn, mode='r') #yield assert_array_equal, ma, arr diff --git a/numpy/lib/ufunclike.py b/numpy/lib/ufunclike.py index 5abdc9c8b..6df529609 100644 --- a/numpy/lib/ufunclike.py +++ b/numpy/lib/ufunclike.py @@ -10,12 +10,12 @@ def fix(x, y=None): """ Round x to nearest integer towards zero. """ x = nx.asanyarray(x) - if y is None: + if y is None: y = nx.zeros_like(x) y1 = nx.floor(x) y2 = nx.ceil(x) y[...] = nx.where(x >= 0, y1, y2) - return y + return y def isposinf(x, y=None): """ |