Skip to content

Commit

Permalink
Merge release-next into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-builder authored Oct 2, 2024
2 parents 90ddf13 + 4a47aa6 commit 70f9b1c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/source/release/v6.11.0/SANS/Bugfixes/38079.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed a crash and improved the error message when no direction checkbox is selected on the ISIS SANS :ref:`ISIS_SANS_Beam_Centre_Tab-ref`.
6 changes: 3 additions & 3 deletions scripts/Interface/ui/sans_isis/beam_centre.ui
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<item row="13" column="0" colspan="5">
<widget class="QGroupBox" name="groupBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls in which directions the algorithm will search for the beam centre.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Controls in which directions the algorithm will search for the beam centre. One or more options must be selected.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="title">
<string>Direction</string>
Expand All @@ -220,7 +220,7 @@
<item>
<widget class="QCheckBox" name="left_right_check_box">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string/>
</property>
<property name="text">
<string>Left/Right</string>
Expand All @@ -230,7 +230,7 @@
<item>
<widget class="QCheckBox" name="up_down_check_box">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string/>
</property>
<property name="text">
<string>Up/Down</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def find_beam_centre(self, state: AllStates, settings: BeamCentreFields) -> Opti
"""
centre_finder = SANSCentreFinder()
if not settings.find_direction:
self._logger.error("Have chosen no find direction exiting early")
return
self._logger.error("No direction has been selected - please select either one or both of the Direction checkboxes.")
raise ValueError("Unable to run beam centre finder as no direction settings have been provided.")

pos_1 = settings.lab_pos_1 if settings.component is DetectorType.LAB else settings.hab_pos_1
pos_2 = settings.lab_pos_2 if settings.component is DetectorType.LAB else settings.hab_pos_2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ def test_beam_centre_errors_with_no_direction(self, mocked_alg):
self.worker.find_beam_centre(state, fields)
self.assertEqual(0, mocked_alg.return_value.call_count)
self.worker._logger.error.assert_called_once()
self.mocked_presenter.on_processing_error_centre_finder.assert_called_once()

0 comments on commit 70f9b1c

Please sign in to comment.