NOAA-GFDL / NDSL

NOAA NASA Domain Specific Language middleware layer
6 stars 8 forks source link

error comparison bug in legacymetric #72

Closed oelbert closed 2 months ago

oelbert commented 2 months ago

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