Ticket #4017 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Nexus2 file fails to load because of date error

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

Description

When I tried to load test file ...mantid/Test/AutoTestData/argus0031800.nxs I got the error

Error in execution of algorithm Load:

Day of month value is out of range 1..31

When fixed or while fixing a unit test needs restoring by changing xtestExec2 back to testExec2 in the header file LoadMuonNexus2Test.h of the data hendling tests.

Change History

comment:1 Changed 9 years ago by Karl Palmen

A look at the start date using HDFView shows it to be 2009-07- 8T10:23:50 which is not a valid ISO date. A '0' is required in place of the space before the '8T' so that the day of month always has two digits as required by the ISO standard.

comment:2 Changed 9 years ago by Nick Draper

  • Owner set to Karl Palmen
  • Status changed from new to assigned

comment:3 Changed 9 years ago by Karl Palmen

Error does NOT arise from std::string DateValidator::checkValidity(const std::string& value) const , which has a slightly different message for the same situation.

comment:4 Changed 9 years ago by Karl Palmen

I've found out that the exception is boost::gregorian::bad_day_of_month which occurs when the invalid date interpreted. The date interpretation could be modified in DateAndTime::set_from_ISO8601_string to prevent this exception from occurring and then use the intended date, possibly logging an error.

Alternatively, we could do nothing and simply require that the application that generates the Muon Nexus file formats its dates correctly.

comment:5 Changed 9 years ago by Anders Markvardsen

Could you in LoadMuonNexus before DateAndTime::set_from_ISO8601_string is executed, test to if this date contains any spaces. If yes, please replace the space with a '0' and write out a warning log message to the user along the lines of: "Invalid data-and-time found. blah blah has been replaced with blah blah", where blah blah should be replaced with the data-and-time before and after modification. Then execute as before.

comment:6 Changed 9 years ago by Karl Palmen

Yes I could do that in DateAndTime::set_from_ISO8601_string. Writing log message may be complicated if none of this code does so.

comment:7 Changed 9 years ago by Karl Palmen

  • Status changed from assigned to accepted

comment:8 Changed 9 years ago by Freddie Akeroyd

  • Cc anders.markvardsen@… added; anders.marksvarden@… removed

comment:9 Changed 9 years ago by Karl Palmen

Handing of Invalid date in ARG file re #4017

Enabled an ARG file to be loaded by correcting and warning about invalid date contained therein. Also enabled unit test that uses this file.

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

Changeset: 66519fa3e6f68b8ace78be4980f84fe5db770666

comment:10 Changed 9 years ago by Karl Palmen

Remove change accidentally committed re #4017

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

Changeset: 2437d31e8f8bfc480d027cd1266c2cebe06bb11d

comment:11 Changed 9 years ago by Karl Palmen

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

comment:12 Changed 9 years ago by Karl Palmen

Handing of Invalid date in ARG file re #4017

Enabled an ARG file to be loaded by correcting and warning about invalid date contained therein. Also enabled unit test that uses this file.

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

Changeset: 66519fa3e6f68b8ace78be4980f84fe5db770666

comment:13 Changed 9 years ago by Karl Palmen

Remove change accidentally committed re #4017

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

Changeset: 2437d31e8f8bfc480d027cd1266c2cebe06bb11d

comment:14 Changed 9 years ago by Anders Markvardsen

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

comment:15 Changed 9 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Works in 9th Jan 2012 version

comment:16 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 4864

Note: See TracTickets for help on using tickets.