diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2014-07-30 15:14:11 -0600 |
---|---|---|
committer | Julian Taylor <jtaylor.debian@googlemail.com> | 2014-07-31 21:08:04 +0200 |
commit | 0b5a6645ee110a8d4c6b5defd8c01791ee48bda1 (patch) | |
tree | dad4ce39a2a89e0655c9cd4b67e66fff90892f1c /numpy/lib/tests/test_nanfunctions.py | |
parent | b2955ede452b8ca2aae5d0b035cd19c8a3b12480 (diff) | |
download | numpy-0b5a6645ee110a8d4c6b5defd8c01791ee48bda1.tar.gz |
STY: PEP8 compliance for numpy/lib/tests.
The possibly controversial part of this is making the nested array
value lists PEP8 compliant, as there is something to be said aligning
the values for clarity. In the end, it seemed like the easiest thing
to do was to make them PEP8 compliant. The eye can get used to that.
Diffstat (limited to 'numpy/lib/tests/test_nanfunctions.py')
-rw-r--r-- | numpy/lib/tests/test_nanfunctions.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py index c5af61434..3da6b5149 100644 --- a/numpy/lib/tests/test_nanfunctions.py +++ b/numpy/lib/tests/test_nanfunctions.py @@ -10,17 +10,17 @@ from numpy.testing import ( # Test data -_ndat = np.array([[0.6244, np.nan, 0.2692, 0.0116, np.nan, 0.1170], - [0.5351, -0.9403, np.nan, 0.2100, 0.4759, 0.2833], - [np.nan, np.nan, np.nan, 0.1042, np.nan, -0.5954], - [0.1610, np.nan, np.nan, 0.1859, 0.3146, np.nan]]) +_ndat = np.array([[0.6244, np.nan, 0.2692, 0.0116, np.nan, 0.1170], + [0.5351, -0.9403, np.nan, 0.2100, 0.4759, 0.2833], + [np.nan, np.nan, np.nan, 0.1042, np.nan, -0.5954], + [0.1610, np.nan, np.nan, 0.1859, 0.3146, np.nan]]) # Rows of _ndat with nans removed -_rdat = [np.array([ 0.6244, 0.2692, 0.0116, 0.1170]), - np.array([ 0.5351, -0.9403, 0.2100, 0.4759, 0.2833]), - np.array([ 0.1042, -0.5954]), - np.array([ 0.1610, 0.1859, 0.3146])] +_rdat = [np.array([0.6244, 0.2692, 0.0116, 0.1170]), + np.array([0.5351, -0.9403, 0.2100, 0.4759, 0.2833]), + np.array([0.1042, -0.5954]), + np.array([0.1610, 0.1859, 0.3146])] class TestNanFunctions_MinMax(TestCase): @@ -205,7 +205,7 @@ class TestNanFunctions_IntTypes(TestCase): int_types = (np.int8, np.int16, np.int32, np.int64, np.uint8, np.uint16, np.uint32, np.uint64) - mat = np.array([127, 39, 93, 87, 46]) + mat = np.array([127, 39, 93, 87, 46]) def integer_arrays(self): for dtype in self.int_types: @@ -383,13 +383,13 @@ class TestNanFunctions_MeanVarStd(TestCase): def test_dtype_error(self): for f in self.nanfuncs: for dtype in [np.bool_, np.int_, np.object]: - assert_raises( TypeError, f, _ndat, axis=1, dtype=np.int) + assert_raises(TypeError, f, _ndat, axis=1, dtype=np.int) def test_out_dtype_error(self): for f in self.nanfuncs: for dtype in [np.bool_, np.int_, np.object]: out = np.empty(_ndat.shape[0], dtype=dtype) - assert_raises( TypeError, f, _ndat, axis=1, out=out) + assert_raises(TypeError, f, _ndat, axis=1, out=out) def test_keepdims(self): mat = np.eye(3) @@ -587,7 +587,7 @@ class TestNanFunctions_Median(TestCase): # Randomly set some elements to NaN: w = np.random.randint(0, d.size, size=d.size // 5) d.ravel()[w] = np.nan - d[:,0] = 1. # ensure at least one good value + d[:,0] = 1. # ensure at least one good value # use normal median without nans to compare tgt = [] for x in d: |