Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: spectrum viewer keyerror no stacks #2261

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/release_notes/2.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Fixes
- #2219: Live viewer: informative error if live directory deleted
- #2246: Don't duplicate ROI names after stack modification
- #2250: A bug where a lock object was trying to be pickled has not been fixed, the median filter is now functional.
- #2242: In the Spectrum Viewer, the Export Tabs now disable when no image stacks are available to prevent a KeyError

Developer Changes
-----------------
Expand All @@ -49,4 +50,4 @@ Developer Changes
- #2183 : Update CIL to 24.0, numpy 1.23, scipy 1.8
- #2196 : Cancel in progress test runs when new commit pushed
- #2213 : unit tests have been added to check that the Time of Flight modes behave correctly when switching between stacks
- #2250 : Make systems tests stricter to catch operations errors
- #2250 : Make systems tests stricter to catch operations errors
4 changes: 4 additions & 0 deletions mantidimaging/gui/windows/spectrum_viewer/presenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def handle_sample_change(self, uuid: UUID | None) -> None:
"""
Called when the stack has been changed in the stack selector.
"""
if len(self.main_window.presenter.model.datasets) == 0:
self.view.exportTabs.setDisabled(True)
else:
self.view.exportTabs.setDisabled(False)
if uuid == self.current_stack_uuid:
return
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from unittest import mock

import numpy as np
from PyQt5.QtWidgets import QPushButton, QActionGroup, QGroupBox, QAction, QCheckBox
from PyQt5.QtWidgets import QPushButton, QActionGroup, QGroupBox, QAction, QCheckBox, QTabWidget
from parameterized import parameterized

from mantidimaging.core.data.dataset import StrictDataset, MixedDataset
Expand Down Expand Up @@ -38,6 +38,7 @@ def setUp(self) -> None:
self.view.exportButtonRITS = mock.create_autospec(QPushButton)
self.view.normalise_ShutterCount_CheckBox = mock.create_autospec(QCheckBox)
self.view.addBtn = mock.create_autospec(QPushButton)
self.view.exportTabs = mock.create_autospec(QTabWidget)
self.view.tof_mode_select_group = mock.create_autospec(QActionGroup)
self.view.tofPropertiesGroupBox = mock.create_autospec(QGroupBox)
self.presenter = SpectrumViewerWindowPresenter(self.view, self.main_window)
Expand Down