Ticket #4603 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Error in operator+= for TimeSeriesProperty

Reported by: Peter Peterson Owned by: Peter Peterson
Priority: major Milestone: Release 2.0
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Russell Taylor

Description

When loading in chunks of event preNeXus files the entire proton charge log is still read in. When putting the chunks together into a single dataset operator+= is used to put the logs together. Since TimeSeriesProperty is implemented using a multimap this effectively repeats the log for each chunk recombined. The correct behavior is to see if the time/value pair already exist before adding. An additional unit test should verify this behavior as well.

Change History

comment:1 Changed 9 years ago by Peter Peterson

  • Status changed from new to accepted
  • Owner set to Peter Peterson

comment:2 Changed 9 years ago by Peter Peterson

Adding unit test to check refs #4603.

Changeset: 10f7b150acbac941bf93071fad21990030e862bf

comment:3 Changed 9 years ago by Peter Peterson

Added == and != to make += behave properly. Refs #4603.

Changeset: f295b01e622325492daab9f0df495f2387a3c2a7

comment:4 Changed 9 years ago by Peter Peterson

Refs #4603. Const correctness.

Changeset: 9801d36706b2b8e289b65ccfc98f0a661aca9a16

comment:5 Changed 9 years ago by Peter Peterson

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

comment:6 Changed 9 years ago by Peter Peterson

Adding unit test to check refs #4603.

Changeset: 10f7b150acbac941bf93071fad21990030e862bf

comment:7 Changed 9 years ago by Peter Peterson

Added == and != to make += behave properly. Refs #4603.

Changeset: f295b01e622325492daab9f0df495f2387a3c2a7

comment:8 Changed 9 years ago by Peter Peterson

Refs #4603. Const correctness.

Changeset: 9801d36706b2b8e289b65ccfc98f0a661aca9a16

comment:9 Changed 9 years ago by Russell Taylor

  • Status changed from verify to verifying
  • Tester set to Russell Taylor

comment:10 Changed 9 years ago by Russell Taylor

  • Status changed from verifying to closed

Looks OK. Adding sections of a 2 chunk event nexus does not 'double' the proton charge log (although I note it does double the gd_proton_chg value which is probably not correct, though not the issue addressed here).

Not quite sure why the vector comparisons couldn't be a single line that looks something like: this->timesAsVector() == right.timesAsVector(). That should do an element-wise comparison.

comment:11 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5450

Note: See TracTickets for help on using tickets.