mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
211 stars 123 forks source link

Error when serial or sequential fit when no data plotted and no fit function defined in EngDiff UI #35595

Closed RichardWaiteSTFC closed 1 year ago

RichardWaiteSTFC commented 1 year ago

Describe the bug Found during manual testing #35541 Error when serial or sequential fit when no data plotted or loaded in EngDiff UI - this is a regression

For Sequential fit it throws this error:

Traceback (most recent call last):
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/fitting/plotting/plot_presenter.py", line 103, in do_seq_fit
    self.fit_all_started_notifier.notify_subscribers(True)
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqt/utils/observer_pattern.py", line 101, in notify_subscribers
    Observable.notify_subscribers(self, *args)
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqt/utils/observer_pattern.py", line 56, in notify_subscribers
    self.thread_safe_update_call(arg, **kwargs)
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqt/utils/qt/qappthreadcall.py", line 69, in __call__
    return self._callable(*args)
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqt/utils/observer_pattern.py", line 60, in _notify_subscribers_impl
    observer.update(self, arg, **kwargs)
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqt/utils/observer_pattern.py", line 93, in update
    self.callback(arg)
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/fitting/presenter.py", line 41, in fit_all_started
    ws_name_list = self.data_widget.get_sorted_active_ws_list()
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/common/data_handling/data_widget.py", line 30, in get_sorted_active_ws_list
    return self.presenter.get_sorted_active_ws_list()
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/common/data_handling/data_presenter.py", line 43, in get_sorted_active_ws_list
    return self.model.get_active_ws_sorted_by_primary_log()
  File "/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/common/data_handling/data_model.py", line 270, in get_active_ws_sorted_by_primary_log
    log_table = ADS.retrieve(primary_log + self._suffix)
KeyError: "'strain_Fitting' does not exist."

For serial fits this error:

TypeError on line 142 of '/home/mlc47243/mambaforge/envs/manualtesting/lib/python3.8/site-packages/mantidqtinterfaces/Engineering/gui/engineering_diffraction/tabs/fitting/plotting/plot_presenter.py': 'NoneType' object is not subscriptable

To Reproduce Test 7 and 9 of manual testing instructions https://developer.mantidproject.org/Testing/EngineeringDiffraction/EngineeringDiffractionTestGuide.html

Expected behavior Buttons should be greyed out or at least not produce an error

Screenshots

Platform/Version (please complete the following information):

Additional context

mantid-builder commented 1 year ago

Fixed by #35615