mantidproject / mslice

Source code for Mantid MSlice
http://mantidproject.github.io/mslice
1 stars 2 forks source link

Clicking plot from MD Histo workspace list causes crash #911

Closed MialLewis closed 1 year ago

MialLewis commented 1 year ago

Describe the bug Clicking plot from MD Histo workspace list causes crash

To Reproduce 1) Plot a slice 2) Take an interactive cut 3) Click save cut to workspace 4) Go onto the MD Histo tab, select cut workspace and click plot.

Stacktrace:

Traceback (most recent call last):
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\app\mainwindow.py", line 189, in button_plot
    self.cut_widget_presenter.notify(cut_command.PlotFromWorkspace)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\presenters\validation_decorators.py", line 11, in wrapper
    return function(*args, **kwargs)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\presenters\cut_widget_presenter.py", line 42, in notify
    self._cut_from_workspace(plot_over=False)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\presenters\cut_widget_presenter.py", line 75, in _cut_from_workspace
    self._cut_plotter_presenter.plot_cut_from_selected_workspace(plot_over)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\presenters\cut_plotter_presenter.py", line 156, in plot_cut_from_selected_workspace
    self.plot_cut_from_workspace(workspace_name, plot_over)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\presenters\cut_plotter_presenter.py", line 161, in plot_cut_from_workspace
    lines = plot_cut_impl(workspace, intensity_range=intensity_range, plot_over=plot_over)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\plotting\globalfiguremanager.py", line 573, in wrapper
    return_value = function(*args, **kwargs)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\views\cut_plotter.py", line 42, in plot_cut_impl
    ax.errorbar(workspace, 'o-', label=legend, picker=PICKER_TOL_PTS,
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\cli\__init__.py", line 28, in errorbar
    return errorbar(self, *args, **kwargs)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\plotting\globalfiguremanager.py", line 573, in wrapper
    return_value = function(*args, **kwargs)
  File "C:\Users\wym92549\AppData\Local\mambaforge\envs\mantidnightly\Library\scripts\ExternalInterfaces\mslice\cli\plotfunctions.py", line 40, in errorbar
    intensity_min, intensity_max = kwargs.pop('intensity_range', (None, None))
TypeError: cannot unpack non-iterable NoneType object

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable/possible, add screenshots to help explain your problem.

MSlice Version (please complete the following information):

Additional context Add any other context about the problem here.