Skip to content

TST: improve the ufunc accuracy tests in test_umath_accuracy #15605

Open

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

Activity

  1. panpiort8 commented on Apr 27, 2020

    @panpiort8
    Contributor

    I can take this issue (at least few points). At first I would (if nobody minds) work on :

    • 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
  2. mattip commented on Apr 27, 2020

    @mattip
    MemberAuthor

    Sounds good, thanks. There was also script in a PR comment to recreate the values, the best would be if we could modify that to generate these data files and soemhow verify that the values are the same as the output of that script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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