Skip to content

Commit

Permalink
Merge pull request #282 from ericpre/fix_empad_test_failure
Browse files Browse the repository at this point in the history
Fix test failure in empad test when pyxem >=0.19 is installed
  • Loading branch information
ericpre authored Jul 10, 2024
2 parents 3edfb2d + f8187be commit 707d80a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rsciio/tests/test_empad.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
# along with RosettaSciIO. If not, see <https://www.gnu.org/licenses/#GPL>.

import gc
import importlib
from importlib.metadata import version
from pathlib import Path

import numpy as np
import pytest
from packaging.version import Version

from rsciio.empad._api import _parse_xml

Expand Down Expand Up @@ -66,7 +69,13 @@ def test_read_stack(lazy):
assert signal_axes[0].name == "width"
assert signal_axes[1].name == "height"
for axis in signal_axes:
assert axis.units == t.Undefined
if importlib.util.find_spec("pyxem") and Version(version("pyxem")) >= Version(
"0.19"
):
units = "px"
else:
units = t.Undefined
assert axis.units == units
assert axis.scale == 1.0
assert axis.offset == -64
navigation_axes = s.axes_manager.navigation_axes
Expand Down

0 comments on commit 707d80a

Please sign in to comment.