Skip to content

Commit

Permalink
PEP8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kevindlewis23 committed Jul 1, 2024
1 parent 1f7b1fd commit 9098a34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions hexrd/matrixutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 3 additions & 2 deletions tests/test_matrix_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -49,4 +50,4 @@ def test_vec_mv_cob_matrix():

T2 = mutil.vecMVCOBMatrix(R)

assert np.allclose(T, T2)
assert np.allclose(T, T2)

0 comments on commit 9098a34

Please sign in to comment.