lsst / afw

LSST data management: pipeline library code and primitives including images and tables
http://dm.lsst.org/
21 stars 22 forks source link

DM-43855: Rework error reporting for assertImagesAlmostEqual #734

Closed parejkoj closed 5 months ago

parejkoj commented 6 months ago

Just reporting the maximum absolute difference does not tell you where np.allclose() was failing, because it uses a relative+absolute comparison.

parejkoj commented 5 months ago

Example error message from this change:

E   AssertionError: variance planes differ: 191989 pixels failing np.allclose(), worst is: |0.5726712942123413 - 1.0| = 0.4273287057876587 > 0.010009999386966228 (rtol*abs(image2)+atol with rtol=1e-05, atol=0.01) at position (150, 154), and maximum absolute error: |0.5726712942123413 - 1.0| = 0.4273287057876587 at position (150, 154).