data-apis / array-api-tests

Test suite for the PyData Array APIs standard
https://data-apis.org/array-api-tests/
MIT License
64 stars 41 forks source link

`test_has_names` fails on missing `fft` extension #282

Open hameerabbasi opened 3 months ago

hameerabbasi commented 3 months ago

I just got these failures updating to v2023.12 of the standard:

FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-fft] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-ifft] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-fftn] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-ifftn] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-rfft] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-irfft] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-rfftn] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-irfftn] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-hfft] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-ihfft] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-fftfreq] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-rfftfreq] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-fftshift] - AttributeError: module 'sparse' has no attribute 'fft'
FAILED ../array-api-tests/array_api_tests/test_has_names.py::test_has_names[fft-ifftshift] - AttributeError: module 'sparse' has no attribute 'fft'

I'm on commit 827edd804bcace9d64176b8115138d29ae3e8dec.

rgommers commented 3 months ago

I think if an extension module is not present, this should either give zero failures or a single failure that must be skipped in the skip file for the library under test.

Also, in case the decision on the above is "single failure", then it would be good to separate testing extensions out from test_has_names with a single test function per extension module, so that the skip can be done per missing extension.

hameerabbasi commented 2 months ago

I've looked at the code; the intended behaviour is zero failures. However -- the code is obscured: A fix isn't straightforward.

asmeurer commented 2 months ago

This is just something that I forgot to test properly. The has_names test should automatically skip those tests if the test suite detects that the fft extension is not enabled. For now, you'll just need to skip those tests in your skips file.