Skip to content

Change tests comparing floats #8

@adam-coogan

Description

@adam-coogan

According to these docs, the assertAlmostEqual(a, b) function, which essentially all of our tests use, checks round(a-b, 7) == 0. This is the wrong thing to do since we want relative errors. For example,

round(1e-20 - 5e-21, 5) == 0
>>> True

We should instead switch over to something like numpy.testing.assert_allclose(), which looks at relative errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions