Ticket #7535 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Slice viewer crashes when passed a workspace with a text axis

Reported by: Samuel Jackson Owned by: Owen Arnold
Priority: major Milestone: Release 3.0
Component: GUI Keywords:
Cc: Blocked By:
Blocking: Tester: Jay Rainey

Description

Slice viewer falls back on the top level error catcher when passed a workspace with a text axis. The attached file can be used to reproduce this bug.

Attachments

DerivsTest_1.nxs (124.2 KB) - added by Samuel Jackson 7 years ago.
File which will cause a crash when opened with slice viewer

Change History

Changed 7 years ago by Samuel Jackson

File which will cause a crash when opened with slice viewer

comment:1 Changed 7 years ago by Nick Draper

  • Owner set to Owen Arnold

comment:2 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress

refs #7535. TextAxis to return min and max without throwing

This is the route cause of the issue with the SliceViewer described by this ticket. If the Text axis stores first and last entries that are not numeric, then a boost lexical cast exception is generated upon getMin and getMax. The fix is to treat this methods as though they have throw() modifiers. Firstly, attempt to cast the first and last values, but if this fails, then fall-back to default numeric values. Unit tests added to verify this new behaviour. Also introduced fix in MatrixWorkspace, MWDimension, whereby, the getMin, getMax were not calling the equivalent methods on the wrapped Axis type.

Changeset: 1ff327000a834e11a3c0f5793e17512c211deb12

comment:3 Changed 7 years ago by Owen Arnold

Tester, here are some things to test:

  • Follow the instructions in the ticket description. You should find that the SliceViewer opens without error. The Y-Axis ranges is 0-1.
  • Code review, and check that the new unit tests are passing.
  • Try the following code, which demonstrates the fix made to the TextAxis
Load('DerivsTest_1.nxs')
mtd.importAll()
axis = DerivsTest_1.getAxis(1)
print axis.extractValues() # Note that these are non-numeric entries, so should default to 0, and 1 as min/max
print axis.getMax() # Should be 1 (default/fall-back)
print axis.getMin() # Should be 0  (default/fall-back)

# Now change the min and max values to be numeric.
axis.setLabel(0, '1')
axis.setLabel(2, '2')
# These should be reflected in the values obtained.
print axis.getMax()
print axis.getMin()

comment:4 Changed 7 years ago by Owen Arnold

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:5 Changed 7 years ago by Jay Rainey

  • Status changed from verify to verifying
  • Tester set to Jay Rainey

comment:6 Changed 7 years ago by Jay Rainey

Testing

  • Slice viewer no longer crashes when passed a workspace with a text axis.
  • All tests pass.
  • Tested on Ubuntu 12.04.

Code review

  • Well written test.
  • Well written explanation of problem in git commit comment.
Last edited 7 years ago by Jay Rainey (previous) (diff)

comment:7 Changed 7 years ago by Jay Rainey

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/7535_slice_viewer_crash'

comment:8 Changed 7 years ago by Nick Draper

  • Component changed from Framework to User Interface

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8380

Note: See TracTickets for help on using tickets.