This PR implements two bug-fixes to SummaryStatsPostProcessor and one bug-fix and one improvement to Optimized.
The two bug-fixes added to SummaryStatsPostProcessor are:
1.A Check the time stamps instead of the bin number when deciding whether a data point should be put in a bin.
1.B Ensure that the last sample before the start of the interval is added, unless the start of the interval coincides with a data-point. (Previously, the last sample would only be added if there existed a data point in the specified interval, but the specified interval may of course be empty.)
The improvements to Optimized are:
2.AintervalSecs is now bounded below by 1. (Previously, it could assume the value 0.)
2.B In the computation of intervalSecs, the cast long -> int is now checked for overflow.
Some test cases have been implemented in OptimizedPostProcessorTest.
Question: I am not sure about point 1.A: is it correct to only include data points that are strictly within the specified interval? E.g.: Suppose the specified interval is [0.5, 1.0] but that the first bin covers the interval [0.0, 1.0]. Should then data-points with, e.g., t=0.4 be added to the first bin? I believe, but I am not sure, that they should not, and that is what the PR implements.
This PR implements two bug-fixes to
SummaryStatsPostProcessor
and one bug-fix and one improvement toOptimized
.The two bug-fixes added to
SummaryStatsPostProcessor
are: 1.A Check the time stamps instead of the bin number when deciding whether a data point should be put in a bin. 1.B Ensure that the last sample before the start of the interval is added, unless the start of the interval coincides with a data-point. (Previously, the last sample would only be added if there existed a data point in the specified interval, but the specified interval may of course be empty.)The improvements to
Optimized
are: 2.AintervalSecs
is now bounded below by 1. (Previously, it could assume the value0
.) 2.B In the computation ofintervalSecs
, the castlong
->int
is now checked for overflow.Some test cases have been implemented in
OptimizedPostProcessorTest
.Question: I am not sure about point 1.A: is it correct to only include data points that are strictly within the specified interval? E.g.: Suppose the specified interval is
[0.5, 1.0]
but that the first bin covers the interval[0.0, 1.0]
. Should then data-points with, e.g.,t=0.4
be added to the first bin? I believe, but I am not sure, that they should not, and that is what the PR implements.