Ticket #9406 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

issue with spaces in <locations>

Reported by: Anders Markvardsen Owned by: Anders Markvardsen
Priority: critical Milestone: Release 3.2
Component: Framework Keywords:
Cc: pkwi@… Blocked By:
Blocking: #9427 Tester: Arturs Bekasovs

Description

Reported by Peter Willendrup

Loading the attached IDF gives the error

Error in execution of algorithm LoadInstrument: bad lexical cast: source type value could not be interpreted as target Error in execution of algorithm LoadEmptyInstrument: bad lexical cast: source type value could not be interpreted as target

This IDF previously worked with release mantid-3.1.20140321.1714

Preliminary investigation indicate that this due to now parser can't handle spaces in <locations> attribute values.

Fix this and also give more meaningful error message if attribute values of <locations> are not valid

It was found by substituting

<component type="MonNDtype-0" name="nD_Mantid_0" idlist="MonNDtype-0-list">

<locations x=" 0.285491" y="-1.5" y-end="1.5" n-elements=" 300" z=" 48.019" rot="61.6534107436081" axis-x="0" axis-y="1" axis-z="0" />

</component>

<type name="MonNDtype-0">

<component type="pixel-0">

<locations r=" 3.99948" t=" -73.3674" t-end=" 73.3676" n-elements=" 100"/>

</component>

</type>

With

<component type="MonNDtype-0" name="nD_Mantid_0" idlist="MonNDtype-0-list">

<locations x="0.285491" y="-1.5" y-end="1.5" n-elements="300" z="48.019" rot="61.6534107436081" axis-x="0" axis-y="1" axis-z="0" />

</component>

<type name="MonNDtype-0">

<component type="pixel-0">

<locations r="3.99948" t="-73.3674" t-end="73.3676" n-elements="100"/>

</component>

</type>

and idf was found to load

Attachments

ILL_H16_IN5.instr.xml (390.7 KB) - added by Anders Markvardsen 6 years ago.

Change History

comment:1 Changed 6 years ago by Anders Markvardsen

  • Status changed from new to assigned

Changed 6 years ago by Anders Markvardsen

comment:2 Changed 6 years ago by Anders Markvardsen

  • Status changed from assigned to inprogress

fix to this ticket. re #9406

Changeset: 24e1c7f671bf70af4d81f6e895dac9e63bd54fb3

comment:3 Changed 6 years ago by Anders Markvardsen

  • Blocking 9427 added

comment:4 Changed 6 years ago by Anders Markvardsen

Update unit test to ex with spaces. re #9406

Changeset: 2c84de22e237ca3e238323832e9ed4939e9c3d45

comment:5 Changed 6 years ago by Anders Markvardsen

To test:

  1. have the unit tests passed
  1. Using LoadEmptyInstrument can you load the attached ILL_H16_IN5.instr.xml file?

If yes then OK

comment:6 Changed 6 years ago by Anders Markvardsen

For information #9427 was created as a maintenace folow up

comment:7 Changed 6 years ago by Anders Markvardsen

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

comment:8 Changed 6 years ago by Arturs Bekasovs

  • Status changed from verify to verifying
  • Tester set to Arturs Bekasovs

comment:9 Changed 6 years ago by Arturs Bekasovs

Unit tests are passing. I was able to load the attached IDF.

The code is OK as a quick fix, but should certainly be re-factored as per #9472.

comment:10 Changed 6 years ago by Arturs Bekasovs

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/9406_locations_spaces'

Full changeset: 9d2db123ec71e48a659c9bdd2e8b5f527b251a78

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10249

Note: See TracTickets for help on using tickets.