mantidproject / mslice

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

Exception when alternating between different intensities #864

Closed SilkeSchomann closed 1 year ago

SilkeSchomann commented 1 year ago

Describe the bug On a slice plot switching between Chi"(Q,E) and Symmetrised S(Q,E) several times causes an exception in the Transpose-v1 algorithm. After clicking on Continue a click on any button on the slice plot causes another exception (list index out of range).

To Reproduce Steps to reproduce the behavior:

  1. Load MAR21335_Ei60meV
  2. Click on Display
  3. Change intensity to Chi"(Q,E)
  4. Change intensity to Symmetrised S(Q,E)
  5. Repeat step 3. and 4. several times
Traceback (most recent call last):
  File "C:\MantidNightlyInstall\bin\lib\site-packages\mantid\simpleapi.py", line 933, in do_set_property
    if isinstance(new_value, _kernel.DataItem) and new_value.name():
RuntimeError: Variable invalidated, data has been deleted.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\plotting\plot_window\slice_plot.py", line 312, in show_intensity_plot
    if not self._run_temp_dependent(slice_plotter_method, previous):
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\plotting\plot_window\slice_plot.py", line 337, in _run_temp_dependent
    slice_plotter_method(self.ws_name)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\presenters\slice_plotter_presenter.py", line 86, in show_symmetrised
    plot_cached_slice(slice_cache, slice_cache.symmetrised)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\views\slice_plotter.py", line 9, in plot_cached_slice
    _show_plot(slice_cache, slice_workspace)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\plotting\globalfiguremanager.py", line 574, in wrapper
    return_value = function(*args, **kwargs)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\views\slice_plotter.py", line 26, in _show_plot
    image = ax.pcolormesh(workspace, cmap=slice_cache.colourmap, norm=slice_cache.norm)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\cli\__init__.py", line 36, in pcolormesh
    return pcolormesh(self, *args, **kwargs)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\plotting\globalfiguremanager.py", line 574, in wrapper
    return_value = function(*args, **kwargs)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\cli\plotfunctions.py", line 137, in pcolormesh
    workspace = Transpose(OutputWorkspace=workspace.name, InputWorkspace=workspace, store=False)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\util\mantid\algorithm_wrapper.py", line 60, in alg_wrapper
    result = algorithm(*args, OutputWorkspace=ads_name, **kwargs)
  File "C:\MantidNightlyInstall\bin\lib\site-packages\mantid\simpleapi.py", line 1068, in __call__
    set_properties(algm, *args, **final_keywords)
  File "C:\MantidNightlyInstall\bin\lib\site-packages\mantid\simpleapi.py", line 956, in set_properties
    do_set_property(key, value)
  File "C:\MantidNightlyInstall\bin\lib\site-packages\mantid\simpleapi.py", line 939, in do_set_property
    raise e.__class__(msg) from e
RuntimeError: Problem setting "InputWorkspace" in Transpose-v1: Variable invalidated, data has been deleted.

The second exception is as follows:

Traceback (most recent call last):
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\plotting\plot_window\plot_figure_manager.py", line 186, in _plot_options
    self.plot_handler.plot_options()
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\plotting\plot_window\slice_plot.py", line 164, in plot_options
    SlicePlotOptionsPresenter(SlicePlotOptions(self.plot_window, redraw_signal=self.plot_window.redraw), self)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\presenters\plot_options_presenter.py", line 34, in __init__
    super(SlicePlotOptionsPresenter, self).__init__(plot_options_dialog, slice_handler)
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\presenters\plot_options_presenter.py", line 13, in __init__
    self.set_properties()  # propagate dialog with existing data
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\presenters\plot_options_presenter.py", line 47, in set_properties
    setattr(self._view, p, getattr(self._model, p))
  File "C:\MantidNightlyInstall\scripts\ExternalInterfaces\mslice\plotting\plot_window\slice_plot.py", line 473, in colorbar_range
    return self._canvas.figure.gca().collections[0].get_clim()
  File "C:\MantidNightlyInstall\bin\lib\site-packages\matplotlib\axes\_base.py", line 1417, in __getitem__
    return [artist
IndexError: list index out of range