Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-9707

Please make assertFloatsAlmostEqual more flexible

    Details

    • Templates:

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rowen Russell Owen
                Watchers:
                Jim Bosch, John Parejko, John Swinbank, Russell Owen, Simon Krughoff
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel