Skip to content

Commit b7e0aaf

Browse files
Merge pull request #38170 from mantidproject/34758_sliceviewer_transpose
34758 fixed issue on ranges in SliceViewer's non orthogonal view
2 parents d77330c + ad83fa0 commit b7e0aaf

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

dev-docs/source/Testing/SliceViewer/SliceViewer.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,19 @@ Test the :ref:`Nonorthogonal view<mantid:sliceviewer_nonortho>`
157157

158158
- Confirm the autoscaling of the colorbar works in non-orthogonal view
159159

160-
3. Change one of the viewing axes to be `L` (e.g. click `X` button next to L in top left of window)
160+
3. Note the range of data in `X` and `Y` axes to be `0 to 2` for `H` and `-1 to +1` for `K` respectively. Swap the viewing axes by clicking `Y` button next to `H` in the top left of the window
161+
162+
- `X` and `Y` axes should now display data for `K` and `H` respectively preserving their original ranges.
163+
164+
4. Click on `X` button next to the `H` button to swap the axes again
165+
166+
- Now `X` and `Y` axes should display data for `H` and `K` respectively preserving their original ranges.
167+
168+
5. Change one of the viewing axes to be `L` (e.g. click `X` button next to L in top left of window)
161169

162170
- Gridlines should now appear to be orthogonal
163171

164-
4. For ``md_4D`` only change one of the viewing axes to be `E` (e.g. click `Y` button next to `E` in top left of window)
172+
6. For ``md_4D`` only change one of the viewing axes to be `E` (e.g. click `Y` button next to `E` in top left of window)
165173

166174
- Nonorthogonal view should be disabled (only enabled for momentum axes)
167175
- Line plots and ROI should be enabled
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fixed a bug in the :ref:sliceviewer which was not showing data with correct ranges when doing a Transpose in non-orthogonal view.

qt/python/mantidqt/mantidqt/widgets/sliceviewer/presenters/presenter.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ def dimensions_changed(self):
225225
else:
226226
self.new_plot()
227227
self._call_cutviewer_presenter_if_created("on_dimension_changed")
228+
if self.view.data_view.nonorthogonal_mode:
229+
self.show_all_data_clicked()
228230

229231
def slicepoint_changed(self):
230232
"""Indicates the slicepoint has been updated"""

qt/python/mantidqt/mantidqt/widgets/sliceviewer/test/test_sliceviewer_presenter.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,23 +370,27 @@ def test_dimensions_changed_when_transpose_2D_MD_workspace(self, mock_sliceinfo_
370370
self.model.get_number_dimensions.return_value = 2
371371
mock_sliceinfo_cls.slicepoint = [None, None] # no slicepoint as 2D ws
372372
data_view_mock.dimensions.get_previous_states.return_value = [0, 1] # no None that indicates integrated dim
373+
presenter.show_all_data_clicked = mock.MagicMock()
373374

374375
presenter.dimensions_changed()
375376

376377
mock_new_plot.assert_called_with(dimensions_transposing=True)
378+
presenter.show_all_data_clicked.assert_not_called()
377379

378380
@mock.patch("mantidqt.widgets.sliceviewer.presenters.presenter.SliceInfo")
379381
def test_changing_dimensions_in_nonortho_mode_switches_to_ortho_when_dim_not_Q(self, mock_sliceinfo_cls):
380382
presenter, data_view_mock = _create_presenter(
381383
self.model, self.view, mock_sliceinfo_cls, enable_nonortho_axes=True, supports_nonortho=False
382384
)
383385
self.model.get_number_dimensions.return_value = 2
386+
presenter.show_all_data_clicked = mock.MagicMock()
384387

385388
presenter.dimensions_changed()
386389

387390
data_view_mock.disable_tool_button.assert_called_once_with(ToolItemText.NONORTHOGONAL_AXES)
388391
data_view_mock.create_axes_orthogonal.assert_called_once()
389392
data_view_mock.create_axes_nonorthogonal.assert_not_called()
393+
presenter.show_all_data_clicked.assert_called_once()
390394

391395
@mock.patch("mantidqt.widgets.sliceviewer.presenters.presenter.SliceInfo")
392396
def test_changing_dimensions_in_nonortho_mode_keeps_nonortho_when_dim_is_Q(self, mock_sliceinfo_cls):

0 commit comments

Comments
 (0)