Ticket #4837 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Allow Overlapping Date Ranges for IDFs so that Latest Range is selected

Reported by: Karl Palmen Owned by: Karl Palmen
Priority: critical Milestone: Release 2.1
Component: Mantid Keywords:
Cc: anders.markvardsen@… Blocked By:
Blocking: Tester: Anders Markvardsen

Description

Suppose an instrument needs its IDF file modified and this modification needs to take effect before the IDF file currently valid for the instrument expires, then it is necessary to modify the currently valid IDF file too, so that its valid date range does not overlap. This is a considereble burden to someone wishing to modify and IDF file.

This would not be necessary if we were to allow valid time ranges to overlap and if there are several currently valid IDF files we select the file with the most recent valid start date.

Change History

comment:1 Changed 9 years ago by Karl Palmen

  • Status changed from new to assigned
  • Priority changed from major to critical
  • Owner set to Karl Palmen

comment:2 Changed 9 years ago by Karl Palmen

  • Cc anders.markvardsen@… added

Made critical after a talk with Anders about it.

comment:3 Changed 9 years ago by Karl Palmen

The overlapping of date ranges is tested in APITest/ExperimentInfoTest/testAllDatesInIDFs . This test will need to be modified to see that the appropriate file is selected when date ranges do overlap.

comment:4 Changed 9 years ago by Karl Palmen

  • Status changed from assigned to accepted

Code found in

std::string ExperimentInfo::getInstrumentFilename(const std::string& instrumentName, const std::string& date)

comment:5 Changed 9 years ago by Karl Palmen

Enabled IDF Files to Overlap re #4837

Unit test checking for overlap now just checks for equal valid-from times. Unit test added to check that correct file is selected when an overlap occurs. The valid dates of these test files are well before the creation if ISIS.

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

Changeset: c371eaf78ddee43e96ad377ce75b459bdb3cdc83

comment:6 Changed 9 years ago by Karl Palmen

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

comment:7 Changed 9 years ago by Russell Taylor

A comment on the 2 'test' instrument definition files added here....

We have a special subdirectory for test IDFs - IDFs_for_UNIT_TESTING under instrument. Please can the files be moved into that (alternatively, you could amend & reuse one of the files already there). The advantage of this is that they will then not be shipped with a Mantid release, which is cleaner.

comment:8 Changed 9 years ago by Karl Palmen

Thank you Russell for your comment. I don't think it is possible to test ExperimentInfo::getInstrumentFilename with the IDFs_for_UNIT_TESTING folder. If I'm wrong please tell me how.

After the users have created some suitable overlapping files we could use them instead.

comment:9 Changed 9 years ago by Russell Taylor

Re #4837. Move test instrument files into directory used for that.

Changeset: 08d4bab4cc24641c749800fbc15884b9bdfd453d

comment:10 Changed 9 years ago by Russell Taylor

Karl - I hope you don't mind that I just went ahead and did this - I was going to send the instructions but I wanted to make sure I wasn't talking rubbish - which meant I had to do it, and once I did that it seemed silly not to just push it up. As you can see, the key is to temporarily change the config property that holds the path to the instrument definition files.

comment:11 Changed 9 years ago by Russell Taylor

Re #4837. Remove print statement.

Changeset: 904ddf7ec4cfd235767007589bb5655ba41b4626

comment:12 Changed 9 years ago by Karl Palmen

Russell - It was OK this time to change the code. I didn't know one could change the folder that ExperimentInfo::getInstrumentFilename uses and the function to do this was not obvious. Looking at the change you made. I see you changed this folder to the test folder before the test and back again after the test.

comment:13 Changed 9 years ago by Karl Palmen

Enabled IDF Files to Overlap re #4837

Unit test checking for overlap now just checks for equal valid-from times. Unit test added to check that correct file is selected when an overlap occurs. The valid dates of these test files are well before the creation if ISIS.

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

Changeset: c371eaf78ddee43e96ad377ce75b459bdb3cdc83

comment:14 Changed 9 years ago by Russell Taylor

Re #4837. Move test instrument files into directory used for that.

Changeset: 08d4bab4cc24641c749800fbc15884b9bdfd453d

comment:15 Changed 9 years ago by Russell Taylor

Re #4837. Remove print statement.

Changeset: 904ddf7ec4cfd235767007589bb5655ba41b4626

comment:16 Changed 8 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:17 Changed 8 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Tested this by changing the EMU IDFs. Including taken out the valid-to tag to test that the IDF still loads - which it did, since this tag is now optional.

Modified the valid-from dates and found that the appropriate IDF is loaded.

Note just now modified the wiki description of valid-to on, http://www.mantidproject.org/InstrumentDefinitionFile#Top_level, to reflect the code changes. Karl can you check that you are happy with this wiki update

comment:18 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5684

Note: See TracTickets for help on using tickets.