Skip to content

TST: improve the ufunc accuracy tests in test_umath_accuracy #15605

@mattip

Description

@mattip

We have a start for testing input, output accuracy for ufuncs in the numpy/core/tests/test_umath_accuracy.py tests (thanks @r-devulap!). It is patterned loosely after the CPython cmath tests, which use a data file of values. The test is a good start, here are a few ways it could be improved:

  • the data files (for instance here are binary only. Maybe the float value could be in a comment at the end of the line?
  • in the CPython cmath tests, every test has a name. The test runs to completion and the failing names are printed
  • the test should run as a pytest.mark.parametrize test for each ufunc tested
  • currently the tests are AVX only since various glibc implementations of math functions vary. Those variations should either be documented or worked around
  • more functions should be tested, and more dtypes as well. Various other tests should be consilidated into this one: like the ones in test_half
  • the README about the data files should more clearly document how to generate correct values.
  • ufuncs should have a way to report the loop chosen so we don't have to guess which SIMD option is active

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