diff --git a/hexrd/matrixutil.py b/hexrd/matrixutil.py index b5000a109..d446d12e5 100644 --- a/hexrd/matrixutil.py +++ b/hexrd/matrixutil.py @@ -264,10 +264,10 @@ def vecMVCOBMatrix(R): for i in range(3): # Other two i values - i1, i2 = [k for k in range(3) if k!= i] + i1, i2 = [k for k in range(3) if k != i] for j in range(3): # Other two j values - j1, j2 = [k for k in range(3) if k!= j] + j1, j2 = [k for k in range(3) if k != j] T[:, i, j] = R[:, i, j] ** 2 T[:, i, j + 3] = sqr2 * R[:, i, j1] * R[:, i, j2] diff --git a/tests/test_matrix_utils.py b/tests/test_matrix_utils.py index 3f9dd6622..510eb0f25 100644 --- a/tests/test_matrix_utils.py +++ b/tests/test_matrix_utils.py @@ -2,10 +2,11 @@ from hexrd import matrixutil as mutil + def test_vec_mv_cob_matrix(): np.random.seed(0) # Generate some random matrices - R = np.random.rand(20,3,3) * 2 - 1 + R = np.random.rand(20, 3, 3) * 2 - 1 T = np.zeros((len(R), 6, 6), dtype='float64') sqr2 = np.sqrt(2) @@ -49,4 +50,4 @@ def test_vec_mv_cob_matrix(): T2 = mutil.vecMVCOBMatrix(R) - assert np.allclose(T, T2) \ No newline at end of file + assert np.allclose(T, T2)