Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
viljarjf committed Jun 11, 2024
1 parent 2c60a1e commit abbaf3f
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions pyxem/tests/signals/test_indexation_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,12 +336,6 @@ def test_to_ipf_markers(self, simple_multi_rot_orientation_result):
markers = orientations.to_ipf_markers()
assert isinstance(markers[0], hs.plot.markers.Markers)

def test_to_ipf_annotation(self, simple_multi_rot_orientation_result):
orientations, rotations, s = simple_multi_rot_orientation_result
annotations = orientations.get_ipf_annotation_markers()
for a in annotations:
assert isinstance(a, hs.plot.markers.Markers)

@pytest.mark.parametrize("add_markers", [True, False])
def test_to_ipf_map(self, simple_multi_rot_orientation_result, add_markers):
orientations, rotations, s = simple_multi_rot_orientation_result
Expand All @@ -350,15 +344,15 @@ def test_to_ipf_map(self, simple_multi_rot_orientation_result, add_markers):
if add_markers:
assert len(navigator.metadata.Markers) == 3

def test_to_phasemap(self, multi_phase_orientation_result):
navigator = multi_phase_orientation_result.to_phase_map()
assert isinstance(navigator, hs.signals.BaseSignal)

def test_multi_phase_errors(self, multi_phase_orientation_result):
with pytest.raises(ValueError):
multi_phase_orientation_result.to_ipf_colormap()
with pytest.raises(ValueError):
multi_phase_orientation_result.to_single_phase_vectors()
with pytest.raises(ValueError):
multi_phase_orientation_result.to_single_phase_orientations()
with pytest.raises(ValueError):
multi_phase_orientation_result.to_ipf_markers()

def test_lazy_error(self, simple_multi_rot_orientation_result):
orientations, rotations, s = simple_multi_rot_orientation_result
Expand All @@ -377,3 +371,12 @@ def test_to_crystal_map_error(self, simple_multi_rot_orientation_result):
def test_plot_over_signal(self, simple_multi_rot_orientation_result):
orientations, rotations, s = simple_multi_rot_orientation_result
orientations.plot_over_signal(s)

def test_plot_over_signal_multi_phase(self, multi_phase_orientation_result):
# Mock signal
s = hs.signals.Signal2D(
np.zeros(multi_phase_orientation_result.data.shape[:-2])[
..., np.newaxis, np.newaxis
]
)
multi_phase_orientation_result.plot_over_signal(s)

0 comments on commit abbaf3f

Please sign in to comment.