When one of the LRs to average is 0.0, the method fails due to an incomplete pattern matching.
def avgLr(result1: Option[LRResult], result2: Option[LRResult]):Option[LRResult] = {
(result1, result2) match {
case (Some(r1), Some(r2)) if r1.total > 0 && r2.total > 0 =>
Some(LRResult((r1.total + r2.total) / 2, avgDetailed(r1.detailed, r2.detailed)))
// There should be an extra case
// case (Some(r1), Some(r2)) => ....
case (Some(r1), None) => result1
case (None, Some(r2)) => result2
case (None, None) => result1
}
}
When one of the LRs to average is 0.0, the method fails due to an incomplete pattern matching.