Describe the bug
The comparison in LegacyMetric if np.isnan(metric_err) or (metric_err > worst_metric_err): can fail if all metric errors are negative real numbers, leading to no "worst index" being assigned and causing a memory error. It also means large negative errors won't be considered as bad as small positive ones, which is undersirable. There is a similar error if all computed vaules are 0
To Reproduce
Run a test where the computed outputs are all smaller than the reference outputs or 0
Expected behavior
metric errors should be calculated correctly and the correct worst index should be found
Describe the bug The comparison in LegacyMetric
if np.isnan(metric_err) or (metric_err > worst_metric_err):
can fail if all metric errors are negative real numbers, leading to no "worst index" being assigned and causing a memory error. It also means large negative errors won't be considered as bad as small positive ones, which is undersirable. There is a similar error if all computed vaules are 0To Reproduce Run a test where the computed outputs are all smaller than the reference outputs or 0
Expected behavior metric errors should be calculated correctly and the correct worst index should be found