Ticket #4464 (closed: wontfix)

Opened 9 years ago

Last modified 5 years ago

Fix SaveAscii when WriteXError is checked.

Reported by: Robert Whitley Owned by: Karl Palmen
Priority: major Milestone: Release 3.0
Component: Framework Keywords:
Cc: Blocked By:
Blocking: #7666 Tester: Keith Brown

Description (last modified by Nick Draper) (diff)

To replicate bug,

1) Load in the file MUSR00015194.nxs

2) Call the algorithm SaveAscii on either "MUSR00015194_1" or "MUSR00015194_2"(making sure WriteXError is checked).

If you save a file this way the following error will appear when you try to load it back into Mantid.

Invalid data format found in file "C:/Users/rqh12525/Desktop/asdgsg.dat" LoadAscii requires the number of columns to be an even multiple of either 2 or 3.Error in execution of algorithm LoadAscii: Invalid data format. Error in execution of algorithm Load: Invalid data format.

Change History

comment:1 Changed 9 years ago by Nick Draper

  • Owner set to Robert Whitley
  • Status changed from new to assigned

comment:2 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.1 to Release 2.2

Moved at end of release 2.1

comment:3 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.2 to Release 2.3

Moved at the end of release 2.2

comment:4 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.3 to Release 2.4

Moved to milestone 2.4

comment:5 Changed 8 years ago by Nick Draper

  • Milestone changed from Release 2.4 to Release 2.5

Moved at the code freeze for release 2.4

comment:6 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.5 to Release 2.6

Moved to r2.6 at the end of r2.5

comment:7 Changed 7 years ago by Nick Draper

  • Owner changed from Robert Whitley to Nick Draper
  • Status changed from assigned to accepted

Retested and found to work

comment:8 Changed 7 years ago by Nick Draper

  • Status changed from accepted to verify
  • Resolution set to worksforme

comment:9 Changed 7 years ago by Mathieu Doucet

  • Status changed from verify to verifying
  • Tester set to Mathieu Doucet

comment:10 Changed 7 years ago by Mathieu Doucet

  • Status changed from verifying to reopened
  • Resolution worksforme deleted

I followed the steps outlined in the description and it did produce the error as described.

comment:11 Changed 7 years ago by Nick Draper

  • Owner changed from Nick Draper to Anyone
  • Description modified (diff)
  • Milestone changed from Release 2.6 to Backlog

comment:12 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:13 Changed 7 years ago by Karl Palmen

  • Owner changed from Anyone to Karl Palmen

comment:14 Changed 7 years ago by Karl Palmen

LoadAscii reckons the number of spectra and the type of errors included based only on the number of columns.

If there are 2 columns, then 1 spectrum with no errors.

Else if there are an odd number of columns, then the number of spectra is assumed to be half the number of columns ignoring the remainder and with Y-errors only.

Else if there are four columns, then 1 spectrum, with both X and Y errors.

There is no support for multiple spectra, except for spectra with Y errors only.

comment:15 Changed 7 years ago by Karl Palmen

I have found that SaveAscii adds only one column of data for the X error, but one X error column header for each spectrum. If the data columns are correct (i.e. there should be just one X error column) a simple fix is in sight.

comment:16 Changed 7 years ago by Karl Palmen

  • Milestone changed from Backlog to Release 3.0

comment:17 Changed 7 years ago by Karl Palmen

  • Status changed from reopened to inprogress

I'll fix for one column of X errors. If a workspace requires a column of X errors for each spectrum, it is really a ragged workspace and this is in the scope of ticket #3493.

comment:18 Changed 7 years ago by Karl Palmen

The bare fix re #4464

Still to do: A check of constant number of columns in LoadAscii and Correct column headers and wiki in SaveAscii.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 2fc54a6c14ebd809ac721b98e60c8f9de09a8d0a

comment:19 Changed 7 years ago by Karl Palmen

Tidied up LoadAscii.cpp checked its format checks re #4464

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: b4e07838845b5346a21ead186c795dd796e5f3cd

comment:20 Changed 7 years ago by Karl Palmen

I've found that LoadAsciiTest does not test for multispectra files. I'll add a test for two spectra without X errors (5 columns) and two spectra with X errors (6 columns). I can use data from the MUSR example mentioned.

comment:21 Changed 7 years ago by Karl Palmen

SaveAsciiTest does not test the writeXError property.

comment:22 Changed 7 years ago by Karl Palmen

Prepare LoadAsciiTest to handle more numbers of columns re #4464

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: d4d6970ea8e55349c4bb8d2a934ea975937d1e7e

comment:23 Changed 7 years ago by Karl Palmen

Skeleton extension of LoadAsciiTest re #4464

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 0b0773a762a1f2241c424a6d77bdea49569959e2

comment:24 Changed 7 years ago by Karl Palmen

Disable new unit tests re #4464

They don't work on is_imc_rhel6_develop and ornl_oxs10.6_develop. LoadAscii fails to read the test file on those systems.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 2036ef5829970fff902ab2fa8fd016897f0cdaf8

comment:25 Changed 7 years ago by Karl Palmen

  • Blocking 7666 added

comment:26 Changed 7 years ago by Karl Palmen

I've created ticket #7666, because I could not quickly get the unit tests I had added to work.

comment:27 Changed 7 years ago by Karl Palmen

Write header for only one X error when needed re #4464

SaveAscii already writes just on X error. This change in the header makes it consistent.

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: a6896e8c60abbf9552d7cd384b78575a036de5e5

comment:28 Changed 7 years ago by Karl Palmen

Update wiki re #4464

Signed-off-by: Karl Palmen <karl.palmen@…>

Changeset: 56410292e8215676fd5a73c025f037458bdcffa0

comment:29 Changed 7 years ago by Karl Palmen

To test create a workspace like that got by loading the MUSR file mentioned in this ticket. Run SaveAscii on it for several spectra with and without the WriteXerror ticked.

Check that the resulting ascii files look OK, the first column is X and is followed by pairs of Y.. E.. columns and if WriteXerror has been selected there is a DX column at the end. Check that the number of columns matches the number of column headers.

Check that it loads OK with LoadAscii (or Load).

comment:30 Changed 7 years ago by Karl Palmen

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

comment:31 Changed 7 years ago by Keith Brown

  • Status changed from verify to verifying
  • Tester changed from Mathieu Doucet to Keith Brown

comment:32 Changed 7 years ago by Keith Brown

  • Blocked By 7732 added

comment:33 Changed 7 years ago by Keith Brown

#7732 is blocking this ticket as SaveAscii seems to be saving files wrongly, so this ticket can't be passed until that's fixed. Assuming that fixing this ticket didn't produce the error.

comment:34 Changed 7 years ago by Keith Brown

  • Status changed from verifying to reopened
  • Resolution fixed deleted
  • Blocked By 7732 removed

Advised by nick that this is a failure case as if SaveASCII has been altered, LoadASCII needs equivalent changes made to it so that the saved file can be loaded.

#7732 isn't blocking any more as the error is totally separate.

comment:35 Changed 7 years ago by Karl Palmen

  • Status changed from reopened to verify
  • Resolution set to wontfix

This ticket has been superceded by #7732, which will amongst other things ensure Xerror works for multiple spectra.

comment:36 Changed 7 years ago by Keith Brown

  • Status changed from verify to verifying

comment:37 Changed 7 years ago by Keith Brown

  • Status changed from verifying to closed

The ticket for sorting out the file format renders this ticket invalid so there's no need to fix this any more.

comment:38 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5311

Note: See TracTickets for help on using tickets.