Skip to content

Provide testing macros/functions like assert_close? #413

Closed
@joshburkart

Description

@joshburkart

In Python, the NumPy library provides nice array-comparison functions for unit tests etc., which I make heavy use of:

import numpy as np

a = np.arange(5, dtype=np.float32) + 1

np.testing.assert_allclose(a, 1e-10 + np.sqrt(a**2))  # Succeeds.
np.testing.assert_allclose(a, 1e-1 + np.sqrt(a**2))  # Fails.

Would it be useful/appropriate to add some of these to this library? I could be interested in working on it, but thought I'd check first.

(Seems like some such functions are used internally, but don't seem to be exported for external use.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions