Skip to content

Commit

Permalink
Merge pull request #155 from asmeurer/numpy-ci-fixes
Browse files Browse the repository at this point in the history
Update NumPy CI for NumPy 2.0
  • Loading branch information
asmeurer authored Jun 25, 2024
2 parents 38ec1d4 + ebb8a8f commit 51daace
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 13 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/array-api-tests-numpy-1-26.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Array API Tests (NumPy 1.26)

on: [push, pull_request]

jobs:
array-api-tests-numpy-latest:
uses: ./.github/workflows/array-api-tests.yml
with:
package-name: numpy
package-version: '== 1.26.*'
xfails-file-extra: '-1-26'
File renamed without changes.
12 changes: 12 additions & 0 deletions dask-skips.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# FFT isn't conformant
array_api_tests/test_fft.py
array_api_tests/test_signatures.py::test_extension_func_signature[fft.fft]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.ifft]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.fftn]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.ifftn]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.rfft]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.irfft]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.rfftn]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.irfftn]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.hfft]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.ihfft]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.fftfreq]
array_api_tests/test_signatures.py::test_extension_func_signature[fft.rfftfreq]

# slow and not implemented in dask
array_api_tests/test_linalg.py::test_matrix_power
47 changes: 47 additions & 0 deletions numpy-1-26-xfails.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# asarray(copy=False) is not yet implemented
array_api_tests/test_creation_functions.py::test_asarray_arrays

# finfo(float32).eps returns float32 but should return float
array_api_tests/test_data_type_functions.py::test_finfo[float32]

# Array methods and attributes not already on np.ndarray cannot be wrapped
array_api_tests/test_has_names.py::test_has_names[array_method-__array_namespace__]
array_api_tests/test_has_names.py::test_has_names[array_method-to_device]
array_api_tests/test_has_names.py::test_has_names[array_attribute-device]
array_api_tests/test_has_names.py::test_has_names[array_attribute-mT]

# Array methods and attributes not already on np.ndarray cannot be wrapped
array_api_tests/test_signatures.py::test_array_method_signature[__array_namespace__]
array_api_tests/test_signatures.py::test_array_method_signature[to_device]

# NumPy deviates in some special cases for floordiv
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
array_api_tests/test_special_cases.py::test_binary[floor_divide(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
array_api_tests/test_special_cases.py::test_binary[__floordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i > 0) -> -infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(x1_i is -infinity and isfinite(x2_i) and x2_i < 0) -> +infinity]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i > 0 and x2_i is -infinity) -> -0]
array_api_tests/test_special_cases.py::test_iop[__ifloordiv__(isfinite(x1_i) and x1_i < 0 and x2_i is +infinity) -> -0]

# https://github.com/numpy/numpy/issues/21213
array_api_tests/test_special_cases.py::test_binary[__pow__(x1_i is -infinity and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[__pow__(x1_i is -0 and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +0]
array_api_tests/test_special_cases.py::test_iop[__ipow__(x1_i is -infinity and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +infinity]
array_api_tests/test_special_cases.py::test_iop[__ipow__(x1_i is -0 and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +0]
array_api_tests/meta/test_hypothesis_helpers.py::test_symmetric_matrices

# The test suite is incorrectly checking sums that have loss of significance
# (https://github.com/data-apis/array-api-tests/issues/168)
array_api_tests/test_statistical_functions.py::test_sum
array_api_tests/test_statistical_functions.py::test_prod
18 changes: 5 additions & 13 deletions numpy-xfails.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
# asarray(copy=False) is not yet implemented
array_api_tests/test_creation_functions.py::test_asarray_arrays

# finfo(float32).eps returns float32 but should return float
array_api_tests/test_data_type_functions.py::test_finfo[float32]

# Array methods and attributes not already on np.ndarray cannot be wrapped
array_api_tests/test_has_names.py::test_has_names[array_method-__array_namespace__]
array_api_tests/test_has_names.py::test_has_names[array_method-to_device]
array_api_tests/test_has_names.py::test_has_names[array_attribute-device]
array_api_tests/test_has_names.py::test_has_names[array_attribute-mT]

# Array methods and attributes not already on np.ndarray cannot be wrapped
array_api_tests/test_signatures.py::test_array_method_signature[__array_namespace__]
array_api_tests/test_signatures.py::test_array_method_signature[to_device]

# NumPy deviates in some special cases for floordiv
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]
Expand Down Expand Up @@ -45,3 +32,8 @@ array_api_tests/meta/test_hypothesis_helpers.py::test_symmetric_matrices
# (https://github.com/data-apis/array-api-tests/issues/168)
array_api_tests/test_statistical_functions.py::test_sum
array_api_tests/test_statistical_functions.py::test_prod

# The test suite cannot properly get the signature for vecdot
# https://github.com/numpy/numpy/pull/26237
array_api_tests/test_signatures.py::test_func_signature[vecdot]
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.vecdot]

0 comments on commit 51daace

Please sign in to comment.