Ticket #11818 (inprogress)

Opened 5 years ago

Last modified 5 years ago

Change the order that instrument files are loaded in preferece for nexus files

Reported by: Nick Draper Owned by: Nick Draper
Priority: major Milestone: Backlog
Component: Framework Keywords: CORE, Maintenance
Cc: Blocked By: #11569
Blocking: Tester:

Description (last modified by Nick Draper) (diff)

At the moment:

For determining the mangled filename

  1. If the filename is present use the file contents if it is available
  2. If the filename is present use the file contents if it is available

for loading the file

  1. if instrument name is not set, undefined behaviour
  2. if instrument_xml is present then load that xml (instrument filename is set to the value in the NXS file, not the nxs file itself)
    1. if filename has been entered them make up a filename out of the directory and instrument name and output an incorrect log message.
  3. Load the most fitting file based on the instrument name
  • At no point would the filename specified be loaded even if correct and present

I suggest we change this to:

For file name mangling:

  1. use the xml string for loading the file from nexus
  2. use the xml string for the file that has been identified from the instrument name

for loading the file:

  1. if instrument_xml is present then load that xml (instrument filename is set to the nxs file itself)
  2. Load the most fitting file based on the instrument name

Change History

comment:1 Changed 5 years ago by Nick Draper

This primarlily involves changes to:

  • ExperimentInfo::loadInstrumentInfoNexus - for the loading order of the IDF itself
  • InstrumentDefinitionParser::getMangledName - for the order of determining the mangled name

comment:2 Changed 5 years ago by Nick Draper

  • Blocked By 11569 added

comment:3 Changed 5 years ago by Nick Draper

  • Description modified (diff)

simplification after TSC discussions

comment:4 Changed 5 years ago by Nick Draper

  • Description modified (diff)

comment:5 Changed 5 years ago by Nick Draper

  • Description modified (diff)

comment:6 Changed 5 years ago by Nick Draper

  • Status changed from new to inprogress

First implementation of changes

  1. IDS mangling used for checksum is now inst name + sha1 of xml 1.1. sha1 is computed after converitng to linux line endings and trim
  2. VTP file names changes to be same filename as IDS mangling
  3. VTP save directory moved to appdata/mantidproject/instrument/geometryCache
  4. VTP file saving simplified as files based on a checksum cannot be out of date
  5. unit tests updated to account for this
  6. unused methods removed from IDFObject
  7. InstrumentDefinitionParser changed to initialise during constructor
  8. XML parsing changed to lazy load rather than during initialisation.

Still to do:

  1. cache SHA1 checksum if needed
  2. Change the filename reported for nexus files
  3. Manually test
  4. Stop saving the filename to nexus files
  5. update documentation

re #11818

Changeset: da16824e65a652b7cfea2f1eed1dfa5920d5ba74

comment:7 Changed 5 years ago by Nick Draper

Further steps as defined below

  1. Change the filename reported for nexus files if xml contained within
  2. Stop saving the filename to nexus processed files
  3. removed some unused includes

Still to do:

  1. cache SHA1 checksum if needed
  2. Manually test
  3. update documentation
  4. investigate this error:

ctest -C Debug -J 4 -R LoadEventNexusTest -V

548: LoadParameterFile-[Error] Bad path syntax: C:\Mantid\Code\Mantid\instrument

\C:\Users\rrc79113\AppData\Roaming\mantidproject\mantid\instrument\HYSPECA_Param eters.xml. Unable to parse File: in C:/Mantid/Code/Mantid/instrument//C:\Users\r rc79113\AppData\Roaming\mantidproject\mantid\instrument\HYSPECA_Parameters.xml 548: LoadIDFFromNexus-[Notice] Instrument parameter file: C:\Users\rrc79113\AppD ata\Roaming\mantidproject\mantid\instrument\HYSPECA_Parameters.xml not found or un-parsable. Instrument parameter file: C:/Mantid/Code/Mantid/instrument/HYSPECA _Parameters.xml has been loaded

re #11818

Changeset: 0e064a7ff78427df06094f3ae56603f09a58247f

comment:8 Changed 5 years ago by Nick Draper

99% tests passed, 4 tests failed out of 1338

Total Test time (real) = 4435.75 sec

The following tests FAILED:
        402 - PythonAlgorithms_CylinderPaalmanPingsCorrectionTest_Debug (Failed) - False positive on my PC

        712 - AlgorithmsTest_CreateDummyCalFileTest (Failed)
        1181 - MDAlgorithmsTest_LoadMDTest (Timeout)
        1195 - MDAlgorithmsTest_MergeMDFilesTest (Failed)
Errors while running CTest
Last edited 5 years ago by Nick Draper (previous) (diff)

comment:9 Changed 5 years ago by Nick Draper

fixed the following unit test failures

712 - AlgorithmsTest_CreateDummyCalFileTest (Failed) 1181 - MDAlgorithmsTest_LoadMDTest (Timeout) 1195 - MDAlgorithmsTest_MergeMDFilesTest (Failed)

re #11818

Changeset: 5ac567bcec5e0b9f6724650ed88e7fcfd7bbc9b4

comment:10 Changed 5 years ago by Nick Draper

Error 4: from above the instrument parameter loading is fixed

re #11818

Changeset: 455e782e08b63666b9fcf0a09674f0ff7e741f15

comment:11 Changed 5 years ago by Nick Draper

Manual test and documentation to go

comment:12 Changed 5 years ago by Nick Draper

manual test passed, documentation to go

comment:13 Changed 5 years ago by Nick Draper

Pull request https://github.com/mantidproject/mantid/pull/815 in order to assess system tests.

Documentation still to do

comment:14 Changed 5 years ago by Nick Draper

re #11818 for doxygen warning

Changeset: b34f136e520d2b6bf8427f283615f65e102d4f75

comment:15 Changed 5 years ago by Nick Draper

re #11818 update documentation

Changeset: c4aded7f68c3ab63583aa6cc4c652087b95142be

comment:16 Changed 5 years ago by Nick Draper

re #11818 update documentation

Changeset: c817b1b2728c342edf72bbf8de8bba5ae352b119

comment:17 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 12656

Note: See TracTickets for help on using tickets.