Skip to content

Commit c479852

Browse files
Merge release-next into ornl-next
2 parents 0198cd0 + 251c8f6 commit c479852

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- A warning will now be displayed if a workspace with unordered spectrum numbers is opened in the :ref:sliceviewer. These workspaces can fail to display correctly and may result in errors.

qt/applications/workbench/workbench/plugins/workspacewidget.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,13 @@ def _do_slice_viewer(self, names):
260260
parent, flags = get_window_config()
261261
for ws in self._ads.retrieveWorkspaces(names, unrollGroups=True):
262262
try:
263+
y = ws.getYDimension()
264+
if y.getName() == "sample":
265+
spec_xvals = [ws.getYDimension().getX(ispec) for ispec in range(ws.getNumberHistograms())]
266+
# Check if the q values are sorted, if not display error
267+
if sorted(spec_xvals) != spec_xvals:
268+
logger.warning("Warning: Invalid Data Format. Consider sorting by sample number and try again")
269+
263270
presenter = SliceViewer(ws=ws, conf=CONF, parent=parent, window_flags=flags)
264271
presenter.view.show()
265272
except Exception as exception:

0 commit comments

Comments
 (0)