Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions dev-docs/source/Testing/SliceViewer/SliceViewer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,19 @@ Test the :ref:`Nonorthogonal view<mantid:sliceviewer_nonortho>`

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

3. Change one of the viewing axes to be `L` (e.g. click `X` button next to L in top left of window)
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

- `X` and `Y` axes should now display data for `K` and `H` respectively preserving their original ranges.

4. Click on `X` button next to the `H` button to swap the axes again

- Now `X` and `Y` axes should display data for `H` and `K` respectively preserving their original ranges.

5. Change one of the viewing axes to be `L` (e.g. click `X` button next to L in top left of window)

- Gridlines should now appear to be orthogonal

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)
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)

- Nonorthogonal view should be disabled (only enabled for momentum axes)
- Line plots and ROI should be enabled
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed a bug in the :ref:sliceviewer which was not showing data with correct ranges when doing a Transpose in non-orthogonal view.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ def dimensions_changed(self):
else:
self.new_plot()
self._call_cutviewer_presenter_if_created("on_dimension_changed")
if self.view.data_view.nonorthogonal_mode:
self.show_all_data_clicked()

def slicepoint_changed(self):
"""Indicates the slicepoint has been updated"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,23 +370,27 @@ def test_dimensions_changed_when_transpose_2D_MD_workspace(self, mock_sliceinfo_
self.model.get_number_dimensions.return_value = 2
mock_sliceinfo_cls.slicepoint = [None, None] # no slicepoint as 2D ws
data_view_mock.dimensions.get_previous_states.return_value = [0, 1] # no None that indicates integrated dim
presenter.show_all_data_clicked = mock.MagicMock()

presenter.dimensions_changed()

mock_new_plot.assert_called_with(dimensions_transposing=True)
presenter.show_all_data_clicked.assert_not_called()

@mock.patch("mantidqt.widgets.sliceviewer.presenters.presenter.SliceInfo")
def test_changing_dimensions_in_nonortho_mode_switches_to_ortho_when_dim_not_Q(self, mock_sliceinfo_cls):
presenter, data_view_mock = _create_presenter(
self.model, self.view, mock_sliceinfo_cls, enable_nonortho_axes=True, supports_nonortho=False
)
self.model.get_number_dimensions.return_value = 2
presenter.show_all_data_clicked = mock.MagicMock()

presenter.dimensions_changed()

data_view_mock.disable_tool_button.assert_called_once_with(ToolItemText.NONORTHOGONAL_AXES)
data_view_mock.create_axes_orthogonal.assert_called_once()
data_view_mock.create_axes_nonorthogonal.assert_not_called()
presenter.show_all_data_clicked.assert_called_once()

@mock.patch("mantidqt.widgets.sliceviewer.presenters.presenter.SliceInfo")
def test_changing_dimensions_in_nonortho_mode_keeps_nonortho_when_dim_is_Q(self, mock_sliceinfo_cls):
Expand Down
Loading