Unverified Commit b82b5f04 authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony Committed by GitHub
Browse files

Merge pull request #30368 from...

Merge pull request #30368 from mantidproject/30311_get_display_indices_for_nonorthog_transform_sliceviewer

Correctly identify display indices for non-orthog transform in sliceviewer
parents 4165e023 3663f334
......@@ -67,6 +67,7 @@ Bugfixes
- Fixed a bug with editing legends in-situ on Linux platforms.
- Fixed a bug in SliceViewer that caused shown data to not update correctly when changing axis selection.
- Fixed bug supplying rebin arguments for non-orthogonal data in sliceviewer that meant that not all the availible data within the axes limits were being plotted.
- Fixed bug in supplying display indices when viewinng axes changed in non-orthog view.
- Fixed a crash in SliceViewer when hovering the cursor over Direct or Indirect data.
- Fixed a crash when using broken e notation for axis limits in plot settings
- Fixed bug in plotting elliptical shell of integrated peaks in sliceviewer - the inner background radius is now correct.
......
......@@ -259,8 +259,8 @@ class SliceViewerModel:
except (AttributeError, KeyError): # run can be None so no .get()
# assume orthogonal projection
proj_matrix = np.diag([1., 1., 1.])
display_indices = slice_info.transform([0, 1, 2]).astype(int)
display_indices = list(range(0, proj_matrix.shape[0]))
display_indices.pop(slice_info.z_index)
return NonOrthogonalTransform.from_lattice(lattice,
x_proj=proj_matrix[:, display_indices[0]],
y_proj=proj_matrix[:, display_indices[1]])
......
......@@ -567,7 +567,7 @@ class SliceViewerModelTest(unittest.TestCase):
self.assertRaises(RuntimeError, model.create_nonorthogonal_transform, (0, 1, 2))
@patch("mantidqt.widgets.sliceviewer.model.NonOrthogonalTransform")
def test_create_non_orthogonal_transform_uses_W_if_avilable(self, mock_nonortho_trans):
def test_create_non_orthogonal_transform_uses_W_if_available(self, mock_nonortho_trans):
ws = _create_mock_workspace(IMDEventWorkspace,
SpecialCoordinateSystem.HKL,
has_oriented_lattice=True)
......@@ -584,11 +584,11 @@ class SliceViewerModelTest(unittest.TestCase):
mock_nonortho_trans.from_lattice.assert_called_once_with(
lattice,
x_proj=ArraysEqual(np.array([1, 0, 0])),
x_proj=ArraysEqual(np.array([0, 0, 1])),
y_proj=ArraysEqual(np.array([1, 1, 0])))
@patch("mantidqt.widgets.sliceviewer.model.NonOrthogonalTransform")
def test_create_non_orthogonal_transform_uses_identity_if_W_unavilable(
def test_create_non_orthogonal_transform_uses_identity_if_W_unavailable(
self, mock_nonortho_trans):
ws = _create_mock_workspace(IMDEventWorkspace,
SpecialCoordinateSystem.HKL,
......@@ -604,7 +604,7 @@ class SliceViewerModelTest(unittest.TestCase):
mock_nonortho_trans.from_lattice.assert_called_once_with(
lattice,
x_proj=ArraysEqual(np.array([0, 1, 0])),
x_proj=ArraysEqual(np.array([1, 0, 0])),
y_proj=ArraysEqual(np.array([0, 0, 1])))
def test_get_dim_limits_returns_limits_for_display_dimensions_for_matrix(self):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment