Skip to content

Commit

Permalink
Trying to identify error in pytest
Browse files Browse the repository at this point in the history
  • Loading branch information
jguarato committed Jan 15, 2025
1 parent bcc68b0 commit 39ec89f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions ross/tests/test_stochastic_rotor_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,16 @@ def test_run_campbell(rotor1):

assert results.wd.shape == (7, 11, 2)
assert results.log_dec.shape == (7, 11, 2)
assert_allclose(results.wd[0, :, :], wd[0, :, :], atol=1e-6)
assert_allclose(results.wd[1, :, :], wd[1, :, :], atol=1e-6)
assert_allclose(results.wd[2, :, :], wd[2, :, :], atol=1e-6)
assert_allclose(results.wd[3, :, :], wd[3, :, :], atol=1e-6)
assert_allclose(results.wd[4, :, :], wd[4, :, :], atol=1e-6)
assert_allclose(results.wd[5, :, :], wd[5, :, :], atol=1e-6)
assert_allclose(results.wd[6, :, :], wd[6, :, :], atol=1e-6)

diff_indices = np.argwhere(~np.isclose(wd, results.wd, atol=1e-6))
differences = [
(tuple(idx), wd[tuple(idx)], results.wd[tuple(idx)]) for idx in diff_indices
]
assert np.allclose(wd, results.wd, atol=1e-6), (
f"Diff - positions: {diff_indices.tolist()} " f"values: {differences}"
)

assert_allclose(results.wd, wd, atol=1e-6)
assert_allclose(results.log_dec, log_dec, atol=1e-6)


Expand Down

0 comments on commit 39ec89f

Please sign in to comment.