Skip to content

Commit

Permalink
fix try/except
Browse files Browse the repository at this point in the history
  • Loading branch information
j-c-c committed Oct 9, 2024
1 parent 19e3554 commit a87353d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,13 +747,12 @@ def check_metadata(sim_src, relion_src):
"""
for k, v in sim_src._metadata.items():
try:
# First try allclose. Loaded metadata might be strings,
# so we cast to the same type as v.
np.testing.assert_array_equal(v, relion_src._metadata[k])
except AssertionError:
# Loaded metadata might be strings so recast.
np.testing.assert_allclose(
v, np.array(relion_src._metadata[k]).astype(type(v[0]))
)
except:
np.testing.assert_array_equal(v, relion_src._metadata[k])


def test_mismatched_pixel_size():
Expand Down

0 comments on commit a87353d

Please sign in to comment.