summaryrefslogtreecommitdiff
path: root/numpy/lib/tests
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r--numpy/lib/tests/test__datasource.py1
-rw-r--r--numpy/lib/tests/test_arraysetops.py2
-rw-r--r--numpy/lib/tests/test_financial.py4
-rw-r--r--numpy/lib/tests/test_function_base.py54
-rw-r--r--numpy/lib/tests/test_index_tricks.py1
-rw-r--r--numpy/lib/tests/test_io.py6
-rw-r--r--numpy/lib/tests/test_polynomial.py3
-rw-r--r--numpy/lib/tests/test_regression.py1
-rw-r--r--numpy/lib/tests/test_shape_base.py2
-rw-r--r--numpy/lib/tests/test_twodim_base.py1
-rw-r--r--numpy/lib/tests/test_ufunclike.py1
11 files changed, 35 insertions, 41 deletions
diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py
index c9e9b2eee..95a72f76a 100644
--- a/numpy/lib/tests/test__datasource.py
+++ b/numpy/lib/tests/test__datasource.py
@@ -318,4 +318,3 @@ class TestOpenFunc(TestCase):
if __name__ == "__main__":
run_module_suite()
-
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index 37a052861..474842c8a 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -16,7 +16,7 @@ class TestAso(TestCase):
d, c = unique1d( a, True )
ed = np.array( [2, 3, 0, 1] )
-
+
assert_array_equal( d,ed )
assert_array_equal( c, ec )
diff --git a/numpy/lib/tests/test_financial.py b/numpy/lib/tests/test_financial.py
index d66430542..1ac14b561 100644
--- a/numpy/lib/tests/test_financial.py
+++ b/numpy/lib/tests/test_financial.py
@@ -3,7 +3,7 @@ import numpy as np
class TestFinancial(TestCase):
def test_rate(self):
- assert_almost_equal(np.rate(10,0,-3500,10000),
+ assert_almost_equal(np.rate(10,0,-3500,10000),
0.1107, 4)
def test_irr(self):
@@ -12,7 +12,7 @@ class TestFinancial(TestCase):
0.0524, 2)
def test_pv(self):
- assert_almost_equal(np.pv(0.07,20,12000,0),
+ assert_almost_equal(np.pv(0.07,20,12000,0),
-127128.17, 2)
def test_fv(self):
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 6e1c3583d..268d0a943 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -297,7 +297,7 @@ class TestGradient(TestCase):
def test_badargs(self):
# for 2D array, gradient can take 0,1, or 2 extra args
x = array([[1,1],[3,4]])
- assert_raises(SyntaxError, gradient, x, array([1.,1.]),
+ assert_raises(SyntaxError, gradient, x, array([1.,1.]),
array([1.,1.]), array([1.,1.]))
class TestAngle(TestCase):
@@ -441,7 +441,7 @@ class TestSinc(TestCase):
class TestHistogram(TestCase):
def setUp(self):
warnings.simplefilter('ignore', Warning)
-
+
def tearDown(self):
warnings.resetwarnings()
@@ -658,60 +658,60 @@ class TestNaNFuncts(TestCase):
def test_nansum(self):
assert_almost_equal(nansum(self.A), 8.0664079100000006)
- assert_almost_equal(nansum(self.A,0),
+ assert_almost_equal(nansum(self.A,0),
array([[ 1.32229056, 0.92403798, 0.39531816],
[ 0.96090861, 1.26908897, 0.99071783],
[ 0.98877405, 0.53370154, 0.68157021]]))
- assert_almost_equal(nansum(self.A,1),
+ assert_almost_equal(nansum(self.A,1),
array([[ 0.40037675, 0.17621204, 0.76778851],
[ 1.30085304, 0.87964135, 0.72217448],
[ 1.57074343, 1.6709751 , 0.57764321]]))
- assert_almost_equal(nansum(self.A,2),
+ assert_almost_equal(nansum(self.A,2),
array([[ 0.02940178, 0.86861904, 0.44635648],
[ 0.97452409, 0.87964135, 1.04850343],
[ 1.63772083, 1.47245502, 0.70918589]]))
-
+
def test_nanmin(self):
assert_almost_equal(nanmin(self.A), 0.01319214)
- assert_almost_equal(nanmin(self.A,0),
+ assert_almost_equal(nanmin(self.A,0),
array([[ 0.59541557, 0.01319214, 0.01620964],
[ 0.11704017, 0.38944762, 0.23913896],
[ 0.28333658, 0.1630199 , 0.33850425]]))
- assert_almost_equal(nanmin(self.A,1),
+ assert_almost_equal(nanmin(self.A,1),
array([[ 0.11704017, 0.01319214, 0.01620964],
[ 0.59541557, 0.87964135, 0.34306596],
[ 0.72687499, 0.37068164, 0.23913896]]))
- assert_almost_equal(nanmin(self.A,2),
+ assert_almost_equal(nanmin(self.A,2),
array([[ 0.01319214, 0.11704017, 0.1630199 ],
[ 0.37910852, 0.87964135, 0.34306596],
[ 0.72687499, 0.23913896, 0.33850425]]))
def test_nanargmin(self):
assert_almost_equal(nanargmin(self.A), 1)
- assert_almost_equal(nanargmin(self.A,0),
+ assert_almost_equal(nanargmin(self.A,0),
array([[1, 0, 0],
[0, 2, 2],
[0, 0, 2]]))
- assert_almost_equal(nanargmin(self.A,1),
+ assert_almost_equal(nanargmin(self.A,1),
array([[1, 0, 0],
[0, 1, 2],
[0, 2, 1]]))
- assert_almost_equal(nanargmin(self.A,2),
+ assert_almost_equal(nanargmin(self.A,2),
array([[1, 0, 1],
[2, 1, 2],
[0, 2, 2]]))
def test_nanmax(self):
assert_almost_equal(nanmax(self.A), 0.91084584000000002)
- assert_almost_equal(nanmax(self.A,0),
+ assert_almost_equal(nanmax(self.A,0),
array([[ 0.72687499, 0.91084584, 0.37910852],
[ 0.84386844, 0.87964135, 0.75157887],
[ 0.70543747, 0.37068164, 0.34306596]]))
- assert_almost_equal(nanmax(self.A,1),
+ assert_almost_equal(nanmax(self.A,1),
array([[ 0.28333658, 0.1630199 , 0.75157887],
[ 0.70543747, 0.87964135, 0.37910852],
[ 0.84386844, 0.91084584, 0.33850425]]))
- assert_almost_equal(nanmax(self.A,2),
+ assert_almost_equal(nanmax(self.A,2),
array([[ 0.01620964, 0.75157887, 0.28333658],
[ 0.59541557, 0.87964135, 0.70543747],
[ 0.91084584, 0.84386844, 0.37068164]]))
@@ -725,22 +725,22 @@ class TestCorrCoef(TestCase):
B = array([[ 0.10377691, 0.5417086 , 0.49807457],
[ 0.82872117, 0.77801674, 0.39226705],
[ 0.9314666 , 0.66800209, 0.03538394]])
- assert_almost_equal(corrcoef(A),
+ assert_almost_equal(corrcoef(A),
array([[ 1. , 0.9379533 , -0.04931983],
[ 0.9379533 , 1. , 0.30007991],
[-0.04931983, 0.30007991, 1. ]]))
- assert_almost_equal(corrcoef(A,B),
- array([[ 1. , 0.9379533 , -0.04931983,
+ assert_almost_equal(corrcoef(A,B),
+ array([[ 1. , 0.9379533 , -0.04931983,
0.30151751, 0.66318558, 0.51532523],
- [ 0.9379533 , 1. , 0.30007991,
+ [ 0.9379533 , 1. , 0.30007991,
-0.04781421, 0.88157256, 0.78052386],
[-0.04931983, 0.30007991, 1. ,
-0.96717111, 0.71483595, 0.83053601],
- [ 0.30151751, -0.04781421, -0.96717111,
+ [ 0.30151751, -0.04781421, -0.96717111,
1. , -0.51366032, -0.66173113],
- [ 0.66318558, 0.88157256, 0.71483595,
+ [ 0.66318558, 0.88157256, 0.71483595,
-0.51366032, 1. , 0.98317823],
- [ 0.51532523, 0.78052386, 0.83053601,
+ [ 0.51532523, 0.78052386, 0.83053601,
-0.66173113, 0.98317823, 1. ]]))
@@ -749,7 +749,7 @@ class Test_i0(TestCase):
def test_simple(self):
assert_almost_equal(i0(0.5), array(1.0634833707413234))
A = array([ 0.49842636, 0.6969809 , 0.22011976, 0.0155549])
- assert_almost_equal(i0(A),
+ assert_almost_equal(i0(A),
array([ 1.06307822, 1.12518299, 1.01214991, 1.00006049]))
B = array([[ 0.827002 , 0.99959078],
[ 0.89694769, 0.39298162],
@@ -768,11 +768,11 @@ class TestKaiser(TestCase):
assert_almost_equal(kaiser(0,1.0), array([]))
assert isnan(kaiser(1,1.0))
assert_almost_equal(kaiser(2,1.0), array([ 0.78984831, 0.78984831]))
- assert_almost_equal(kaiser(5,1.0),
- array([ 0.78984831, 0.94503323, 1. ,
+ assert_almost_equal(kaiser(5,1.0),
+ array([ 0.78984831, 0.94503323, 1. ,
0.94503323, 0.78984831]))
- assert_almost_equal(kaiser(5,1.56789),
- array([ 0.58285404, 0.88409679, 1. ,
+ assert_almost_equal(kaiser(5,1.56789),
+ array([ 0.58285404, 0.88409679, 1. ,
0.88409679, 0.58285404]))
class TestMsort(TestCase):
diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
index 3cfed1059..47529502d 100644
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -64,4 +64,3 @@ class TestConcatenator(TestCase):
if __name__ == "__main__":
run_module_suite()
-
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index c6a8498eb..1d2c2321a 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -57,7 +57,7 @@ class TestSavezLoad(RoundtripTest, TestCase):
l = np.load(c)
assert_equal(a, l['file_a'])
assert_equal(b, l['file_b'])
-
+
class TestSaveTxt(TestCase):
def test_array(self):
@@ -220,8 +220,8 @@ class TestLoadTxt(TestCase):
c.seek(0)
x = np.loadtxt(c, dtype=float, usecols=(1,2))
assert_array_equal(x, a[:,1:])
-
- # Checking with dtypes defined converters.
+
+ # Checking with dtypes defined converters.
data = '''JOE 70.1 25.3
BOB 60.5 27.9
'''
diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py
index 406c151a1..96dd084b2 100644
--- a/numpy/lib/tests/test_polynomial.py
+++ b/numpy/lib/tests/test_polynomial.py
@@ -77,7 +77,7 @@ from numpy.testing import *
import numpy as np
class TestDocs(TestCase):
- def test_doctests(self):
+ def test_doctests(self):
return rundocs()
def test_roots(self):
@@ -113,4 +113,3 @@ class TestDocs(TestCase):
if __name__ == "__main__":
run_module_suite()
-
diff --git a/numpy/lib/tests/test_regression.py b/numpy/lib/tests/test_regression.py
index 7d7db93e4..189b2e481 100644
--- a/numpy/lib/tests/test_regression.py
+++ b/numpy/lib/tests/test_regression.py
@@ -28,4 +28,3 @@ class TestRegression(TestCase):
if __name__ == "__main__":
run_module_suite()
-
diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py
index a4e771876..59c48dba0 100644
--- a/numpy/lib/tests/test_shape_base.py
+++ b/numpy/lib/tests/test_shape_base.py
@@ -13,7 +13,7 @@ class TestApplyAlongAxis(TestCase):
def test_3d(self):
a = arange(27).reshape((3,3,3))
- assert_array_equal(apply_along_axis(sum,0,a),
+ assert_array_equal(apply_along_axis(sum,0,a),
[[27,30,33],[36,39,42],[45,48,51]])
diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
index 2dd3f3365..32c4ca58e 100644
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -195,4 +195,3 @@ class TestTri(TestCase):
if __name__ == "__main__":
run_module_suite()
-
diff --git a/numpy/lib/tests/test_ufunclike.py b/numpy/lib/tests/test_ufunclike.py
index a7fbccea1..bd941adad 100644
--- a/numpy/lib/tests/test_ufunclike.py
+++ b/numpy/lib/tests/test_ufunclike.py
@@ -65,4 +65,3 @@ def test():
if __name__ == "__main__":
run_module_suite()
-