mantidproject / mantid

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

Error from cursor info when viewing MDHisto in sliceviewer #35000

Open RichardWaiteSTFC opened 1 year ago

RichardWaiteSTFC commented 1 year ago

Describe the bug Difficult to reproduce, but moving cursor off the edge of MDHisto workspace produces an error

To Reproduce (1) Make workspace

ws = CreateMDWorkspace(Dimensions='3', Extents='-3,3,-3,3,-3,3',
                   Names='H,K,L', Units='r.l.u.,r.l.u.,r.l.u.',
                   Frames='HKL,HKL,HKL',
                   SplitInto='2', SplitThreshold='10')
FakeMDEventData(InputWorkspace=ws, UniformParams='1e2') # 4D data
BinMD(InputWorkspace=ws, AxisAligned=False,
    BasisVector0='[00L],r.l.u.,0,0,1',
    BasisVector1='[HH0],r.l.u.,1,1,0',
    BasisVector2='[-HH0],r.l.u.,-1,1,0',
    OutputExtents='-4,4,-4,4,-1,1',
    OutputBins='5,5,5', OutputWorkspace='ws_histo', NormalizeBasisVectors=False)
DeleteWorkspace(ws)

(2) Open ws_histo in sliceviewer (3) Zoom out so edge of data is visible (4) move cursor outside extent of the data

Traceback (most recent call last):
 File "C:\MantidNightlyInstall\bin\lib\site-packages\matplotlib\cbook\__init__.py", line 307, in process
 func(*args, **kwargs)
 File "C:\MantidNightlyInstall\bin\lib\site-packages\mantidqt\widgets\sliceviewer\views\cursor.py", line 57, in on_mouse_leave
 self.on_cursor_outside_axes()
 File "C:\MantidNightlyInstall\bin\lib\site-packages\mantidqt\widgets\sliceviewer\presenters\imageinfowidget.py", line 66, in on_cursor_outside_axes
 extra_cols = self._presenter.get_extra_image_info_columns(DBLMAX, DBLMAX)
 File "C:\MantidNightlyInstall\bin\lib\site-packages\mantidqt\widgets\sliceviewer\presenters\presenter.py", line 540, in get_extra_image_info_columns
 if len(qdims) == 3 and self.get_frame() == SpecialCoordinateSystem.HKL:
 File "C:\MantidNightlyInstall\bin\lib\site-packages\mantidqt\widgets\sliceviewer\presenters\presenter.py", line 171, in get_frame
 return self.model.get_frame()
 File "C:\MantidNightlyInstall\bin\lib\site-packages\mantidqt\widgets\sliceviewer\models\model.py", line 148, in get_frame
 return self._ws.getSpecialCoordinateSystem()
RuntimeError: Variable invalidated, data has been deleted.
sf1919 commented 1 year ago

I am unable to recreate this bug on Windows 10 using Nightly version 6.6.20230407.0856. Maybe this has been fixed?

RichardWaiteSTFC commented 1 year ago

I can reproduce this on IDAaaS using nightly from 02/06/23 - but it happens very rarely!