Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit724d86e

Browse files
committed
Apply review comments
1 parent4373469 commit724d86e

File tree

4 files changed

+77
-35
lines changed

4 files changed

+77
-35
lines changed

‎.github/workflows/linux.yml‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,9 @@ jobs:
222222
uses:actions/checkout@v3
223223
with:
224224
repository:data-apis/array-api-tests
225-
ref:'83f0bcdcc5286250dbb26be5d37511702970b4dc'# Latest commit as of 2023-11-15
225+
ref:'9afe8c709d81f005c98d383c82ad5e1c2cd8166c'# Latest commit as of 2023-11-24
226226
submodules:'true'
227227
path:'array-api-tests'
228-
-name:Fix array-apis bug
229-
# Temporary workaround for https://github.com/data-apis/array-api/issues/631
230-
run:|
231-
sed -i -e 's/\\/\\\\/g' array-api-tests/array-api/spec/API_specification/signatures/*.py
232228
-name:Set up Python
233229
uses:actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236# v4.7.1
234230
with:
@@ -237,17 +233,19 @@ jobs:
237233
run:|
238234
python -m pip install -r build_requirements.txt
239235
python -m pip install -r test_requirements.txt
240-
python -m pip install hypothesis!=6.88.4 # 6.88.4 leads to a strange error
241236
python -m pip install -r array-api-tests/requirements.txt
242237
-name:Build and install NumPy
243238
run:|
244239
python -m pip install . -v -Csetup-args=-Dallow-noblas=true -Csetup-args=-Dcpu-baseline=none -Csetup-args=-Dcpu-dispatch=none
245240
-name:Run the test suite
246241
env:
247242
ARRAY_API_TESTS_MODULE:numpy
243+
PYTHONWARNINGS:'ignore::UserWarning::,ignore::DeprecationWarning::,ignore::RuntimeWarning::'
248244
run:|
249245
cd ${GITHUB_WORKSPACE}/array-api-tests
250-
pytest array_api_tests -v -W ignore::pytest.PytestDeprecationWarning -W ignore::RuntimeWarning -W ignore::DeprecationWarning --ci --max-examples=2 --derandomize --disable-deadline --skips-file ${GITHUB_WORKSPACE}/array-api-skips.txt
246+
# remove once https://github.com/data-apis/array-api-tests/pull/217 is merged
247+
touch pytest.ini
248+
pytest array_api_tests -v -c pytest.ini --ci --max-examples=2 --derandomize --disable-deadline --skips-file ${GITHUB_WORKSPACE}/tools/ci/array-api-skips.txt
251249
252250
custom_checks:
253251
needs:[smoke_test]

‎numpy/_core/src/multiarray/methods.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2767,9 +2767,10 @@ array_array_namespace(PyArrayObject *self, PyObject *args, PyObject *kwds)
27672767
returnNULL;
27682768
}
27692769

2770-
if (strcmp(array_api_version,"2022.12")!=0) {
2770+
if (strcmp(array_api_version,"2021.12")!=0&&
2771+
strcmp(array_api_version,"2022.12")!=0) {
27712772
PyErr_Format(PyExc_ValueError,
2772-
"Version \"%s\" of Array API is not supported.",
2773+
"Version \"%s\" oftheArray API Standard is not supported.",
27732774
array_api_version);
27742775
returnNULL;
27752776
}

‎numpy/_core/tests/test_regression.py‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2556,3 +2556,20 @@ def test_load_ufunc_pickle(self):
25562556
test_data=b'\x80\x04\x95(\x00\x00\x00\x00\x00\x00\x00\x8c\x1cnumpy.core._multiarray_umath\x94\x8c\x03add\x94\x93\x94.'# noqa
25572557
result=pickle.loads(test_data,encoding='bytes')
25582558
assertresultisnp.add
2559+
2560+
deftest__array_namespace__(self):
2561+
arr=np.arange(2)
2562+
2563+
xp=arr.__array_namespace__()
2564+
assertxpisnp
2565+
xp=arr.__array_namespace__(api_version="2021.12")
2566+
assertxpisnp
2567+
xp=arr.__array_namespace__(api_version="2022.12")
2568+
assertxpisnp
2569+
2570+
withpytest.raises(
2571+
ValueError,
2572+
match="Version\"2023.12\" of the Array API Standard "
2573+
"is not supported."
2574+
):
2575+
arr.__array_namespace__(api_version="2023.12")
Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
11
# copy not implemented
22
array_api_tests/test_creation_functions.py::test_asarray_arrays
33

4-
# https://github.com/numpy/numpy/issues/20870
5-
array_api_tests/test_data_type_functions.py::test_can_cast
6-
7-
# The return dtype for trace is not consistent in the spec
8-
# https://github.com/data-apis/array-api/issues/202#issuecomment-952529197
9-
array_api_tests/test_linalg.py::test_trace
10-
114
# waiting on NumPy to allow/revert distinct NaNs for np.unique
125
# https://github.com/numpy/numpy/issues/20326#issuecomment-1012380448
136
array_api_tests/test_set_functions.py
147

15-
# newaxis not included in numpy namespace as of v1.26.2
16-
array_api_tests/test_constants.py::test_newaxis
17-
18-
# linalg.solve issue in numpy.array_api as of v1.26.2 (see numpy#25146)
19-
array_api_tests/test_linalg.py::test_solve
20-
21-
# https://github.com/numpy/numpy/issues/21373
22-
array_api_tests/test_array_object.py::test_getitem
23-
24-
# missing copy arg
25-
array_api_tests/test_signatures.py::test_func_signature[reshape]
26-
27-
# https://github.com/numpy/numpy/issues/21211
28-
array_api_tests/test_special_cases.py::test_iop[__iadd__(x1_i is -0 and x2_i is -0) -> -0]
298
# https://github.com/numpy/numpy/issues/21213
309
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]
3110
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]
@@ -54,15 +33,13 @@ array_api_tests/test_array_object.py::test_setitem
5433
# array_api_tests/test_array_object.py::test_setitem_masking
5534
array_api_tests/test_creation_functions.py::test_asarray_scalars
5635

57-
# astype is not defined in numpy
58-
array_api_tests/test_data_type_functions.py::test_astype
59-
6036
# fft test suite is buggy as of 83f0bcdc
6137
array_api_tests/test_fft.py
6238

63-
# missing isdtype and finfo return type misalignment
39+
# missing isdtype, astype and finfo return type misalignment
6440
array_api_tests/test_data_type_functions.py::test_finfo[float32]
6541
array_api_tests/test_data_type_functions.py::test_isdtype
42+
array_api_tests/test_data_type_functions.py::test_astype
6643

6744
# missing names
6845
array_api_tests/test_has_names.py::test_has_names[linalg-cross]
@@ -81,6 +58,7 @@ array_api_tests/test_has_names.py::test_has_names[set-unique_values]
8158
array_api_tests/test_has_names.py::test_has_names[manipulation-concat]
8259
array_api_tests/test_has_names.py::test_has_names[manipulation-permute_dims]
8360
array_api_tests/test_has_names.py::test_has_names[data_type-astype]
61+
array_api_tests/test_has_names.py::test_has_names[data_type-isdtype]
8462
array_api_tests/test_has_names.py::test_has_names[elementwise-acos]
8563
array_api_tests/test_has_names.py::test_has_names[elementwise-acosh]
8664
array_api_tests/test_has_names.py::test_has_names[elementwise-asin]
@@ -112,7 +90,55 @@ array_api_tests/test_manipulation_functions.py::test_permute_dims
11290

11391
# a few misalignments
11492
array_api_tests/test_operators_and_elementwise_functions.py
115-
array_api_tests/test_signatures.py
93+
array_api_tests/test_signatures.py::test_func_signature[std]
94+
array_api_tests/test_signatures.py::test_func_signature[var]
95+
array_api_tests/test_signatures.py::test_func_signature[unique_all]
96+
array_api_tests/test_signatures.py::test_func_signature[unique_counts]
97+
array_api_tests/test_signatures.py::test_func_signature[unique_inverse]
98+
array_api_tests/test_signatures.py::test_func_signature[unique_values]
99+
array_api_tests/test_signatures.py::test_func_signature[asarray]
100+
array_api_tests/test_signatures.py::test_func_signature[empty_like]
101+
array_api_tests/test_signatures.py::test_func_signature[eye]
102+
array_api_tests/test_signatures.py::test_func_signature[full]
103+
array_api_tests/test_signatures.py::test_func_signature[full_like]
104+
array_api_tests/test_signatures.py::test_func_signature[linspace]
105+
array_api_tests/test_signatures.py::test_func_signature[ones]
106+
array_api_tests/test_signatures.py::test_func_signature[ones_like]
107+
array_api_tests/test_signatures.py::test_func_signature[zeros_like]
108+
array_api_tests/test_signatures.py::test_func_signature[concat]
109+
array_api_tests/test_signatures.py::test_func_signature[permute_dims]
110+
array_api_tests/test_signatures.py::test_func_signature[reshape]
111+
array_api_tests/test_signatures.py::test_func_signature[argsort]
112+
array_api_tests/test_signatures.py::test_func_signature[sort]
113+
array_api_tests/test_signatures.py::test_func_signature[astype]
114+
array_api_tests/test_signatures.py::test_func_signature[isdtype]
115+
array_api_tests/test_signatures.py::test_func_signature[acos]
116+
array_api_tests/test_signatures.py::test_func_signature[acosh]
117+
array_api_tests/test_signatures.py::test_func_signature[asin]
118+
array_api_tests/test_signatures.py::test_func_signature[asinh]
119+
array_api_tests/test_signatures.py::test_func_signature[atan]
120+
array_api_tests/test_signatures.py::test_func_signature[atan2]
121+
array_api_tests/test_signatures.py::test_func_signature[atanh]
122+
array_api_tests/test_signatures.py::test_func_signature[bitwise_left_shift]
123+
array_api_tests/test_signatures.py::test_func_signature[bitwise_invert]
124+
array_api_tests/test_signatures.py::test_func_signature[bitwise_right_shift]
125+
array_api_tests/test_signatures.py::test_func_signature[pow]
126+
array_api_tests/test_signatures.py::test_func_signature[matrix_transpose]
127+
array_api_tests/test_signatures.py::test_func_signature[vecdot]
128+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.cross]
129+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.matmul]
130+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.cholesky]
131+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.matrix_norm]
132+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.matrix_rank]
133+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.matrix_transpose]
134+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.outer]
135+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.pinv]
136+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.svdvals]
137+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.tensordot]
138+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.vecdot]
139+
array_api_tests/test_signatures.py::test_extension_func_signature[linalg.vector_norm]
140+
array_api_tests/test_signatures.py::test_array_method_signature[__array_namespace__]
141+
array_api_tests/test_signatures.py::test_array_method_signature[to_device]
116142

117143
# unexpected argument 'stable'
118144
array_api_tests/test_sorting_functions.py::test_argsort

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp