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

Spectrum Viewer Export Tabs disable when no stacks are available #2259

Merged
merged 3 commits into from
Jul 8, 2024

Conversation

MikeSullivan7
Copy link
Collaborator

Issue

Close #2242

Description

When a stack is modified from the main window (e.g. deleted), the spectrum viewer now checks to see if there is an imagestack available to display. If no data is available (i.e. all data has been deleted), then the Export Tab area is disabled. This prevents a KeyError from occurring when changing ExportTab while there is no imagestack.

Testing

make check

Acceptance Criteria

  1. Open MI and load in data
  2. Open the Spectrum Viewer
  3. In the Main Window, delete the data you just loaded in
  4. Check in the Spectrum Viewer that no sample stacks are available and that the Export Tabs have been disabled, and therefore no error occurs.
  5. In the Main Window, load in some more data.
  6. Check that the Export Tabs have now been re-enabled and function as normal.

Documentation

Will add release note

@coveralls
Copy link

Coverage Status

coverage: 73.152% (+0.008%) from 73.144%
when pulling 00c0b69 on 2242_spectrum_viewer_keyerror_no_stacks
into 27975ce on main.

Copy link
Collaborator

@samtygier-stfc samtygier-stfc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good solution. I've tested that it resolves the issue.

@samtygier-stfc samtygier-stfc added this pull request to the merge queue Jul 8, 2024
Merged via the queue into main with commit dcafc8f Jul 8, 2024
8 checks passed
@samtygier-stfc samtygier-stfc deleted the 2242_spectrum_viewer_keyerror_no_stacks branch July 8, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spectrum Viewer KeyError when no stacks available
3 participants