Details
-
Type:
Story
-
Status: To Do
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: utils
-
Labels:
Description
lsst.utils.assertFloatsAlmostEqual cannot handle lists of floats. Thus it cannot handle values returned from C++ as std::vector. Similarly for tuples of floats, lists of lists of floats, etc., though those may be rarer.
The usual workaround is to use self.assertTrue(numpy.allclose(arr1, arr2)) but it would be nice not to have to do that.
Also please consider adding a equal_nan flag like numpy.allclose. In both cases it is worth considering using numpy allclose as the code that performs the test.
Adding a ticket I filed earlier about using np.allclose. Also removed myself as the assignee: I'm not taking responsibility for this code, I just documented its availability!