Skip to content

Commit 9991697

Browse files
vtavanaVahid Tavanashad
authored andcommitted
Merge branch 'master' into update-tests-search-special-statistics-umath
2 parents 61216dd + b09533e commit 9991697

File tree

8 files changed

+108
-92
lines changed

8 files changed

+108
-92
lines changed

.github/workflows/check-mkl-interfaces.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env:
2020
onedpl-devel
2121
setuptools
2222
python
23-
numpy">=2.0"
23+
numpy
2424
cython
2525
cmake
2626
ninja
@@ -32,7 +32,9 @@ jobs:
3232

3333
strategy:
3434
matrix:
35-
python: ['3.13']
35+
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
36+
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
37+
python: ['3.12']
3638
os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
3739

3840
permissions:
@@ -125,7 +127,9 @@ jobs:
125127

126128
strategy:
127129
matrix:
128-
python: ['3.13']
130+
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
131+
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
132+
python: ['3.12']
129133
os: [ubuntu-22.04] # windows-2019 - no DFT support for Windows in oneMKL
130134

131135
permissions:

.github/workflows/conda-package.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ env:
1616
CONDA_BUILD_INDEX_ENV_PY_VER: '3.12' # conda does not support python 3.13
1717
CONDA_BUILD_VERSION: '25.1.1'
1818
CONDA_INDEX_VERSION: '0.5.0'
19-
LATEST_PYTHON: '3.13'
19+
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
20+
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
21+
LATEST_PYTHON: '3.12'
2022
RERUN_TESTS_ON_FAILURE: 'true'
2123
RUN_TESTS_MAX_ATTEMPTS: 2
2224
TEST_ENV_NAME: 'test'
@@ -31,7 +33,9 @@ jobs:
3133
strategy:
3234
fail-fast: false
3335
matrix:
34-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
36+
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
37+
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
38+
python: ['3.9', '3.10', '3.11', '3.12']
3539
os: [ubuntu-22.04, windows-2019]
3640

3741
permissions:
@@ -124,7 +128,8 @@ jobs:
124128
strategy:
125129
fail-fast: false
126130
matrix:
127-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
131+
# python 3.13 is blocked due to MKL issue
132+
python: ['3.9', '3.10', '3.11', '3.12']
128133
os: [ubuntu-latest]
129134

130135
env:
@@ -253,7 +258,8 @@ jobs:
253258
strategy:
254259
fail-fast: false
255260
matrix:
256-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
261+
# python 3.13 is blocked due to MKL issue
262+
python: ['3.9', '3.10', '3.11', '3.12']
257263
os: [windows-2019]
258264

259265
env:
@@ -389,7 +395,8 @@ jobs:
389395

390396
strategy:
391397
matrix:
392-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
398+
# python 3.13 is blocked due to MKL issue
399+
python: ['3.9', '3.10', '3.11', '3.12']
393400
os: [ubuntu-22.04, windows-2019]
394401

395402
runs-on: ${{ matrix.os }}

.github/workflows/cron-run-tests.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ jobs:
3737
strategy:
3838
fail-fast: false
3939
matrix:
40-
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
40+
# python 3.13 is blocked since BLAS requires "mkl<2025.0" (see https://github.com/conda-forge/blas-feedstock/pull/128
41+
# which depends on resolving MKL issue https://github.com/conda-forge/intel_repack-feedstock/issues/83)
42+
python: ['3.9', '3.10', '3.11', '3.12']
4143
runner: [ubuntu-22.04, ubuntu-24.04, windows-2019]
4244

4345
steps:

dpnp/tests/test_search.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_func(self, func, axis, keepdims, dtype):
2323

2424
expected = getattr(numpy, func)(a, axis=axis, keepdims=keepdims)
2525
result = getattr(dpnp, func)(ia, axis=axis, keepdims=keepdims)
26-
assert_array_equal(result, expected, strict=True)
26+
assert_array_equal(result, expected)
2727

2828
@pytest.mark.parametrize("func", ["argmax", "argmin"])
2929
def test_out(self, func):
@@ -35,13 +35,13 @@ def test_out(self, func):
3535
dpnp_out = dpnp.empty(expected.shape, dtype=expected.dtype)
3636
result = getattr(dpnp, func)(ia, axis=0, out=dpnp_out)
3737
assert dpnp_out is result
38-
assert_array_equal(result, expected, strict=True)
38+
assert_array_equal(result, expected)
3939

4040
# out is usm_ndarray
4141
dpt_out = dpt.empty(expected.shape, dtype=expected.dtype)
4242
result = getattr(dpnp, func)(ia, axis=0, out=dpt_out)
4343
assert dpt_out is result.get_array()
44-
assert_array_equal(result, expected, strict=True)
44+
assert_array_equal(result, expected)
4545

4646
# out is a numpy array -> TypeError
4747
result = numpy.empty_like(expected)
@@ -64,7 +64,7 @@ def test_out_dtype(self, func, arr_dt, out_dt):
6464
if numpy.can_cast(out.dtype, numpy.intp, casting="safe"):
6565
result = getattr(dpnp, func)(ia, out=iout, axis=1)
6666
expected = getattr(numpy, func)(a, out=out, axis=1)
67-
assert_array_equal(result, expected, strict=True)
67+
assert_array_equal(result, expected)
6868
assert result is iout
6969
else:
7070
assert_raises(TypeError, getattr(numpy, func), a, out=out, axis=1)
@@ -79,7 +79,7 @@ def test_ndarray(self, func, axis, keepdims):
7979

8080
expected = getattr(a, func)(axis=axis, keepdims=keepdims)
8181
result = getattr(ia, func)(axis=axis, keepdims=keepdims)
82-
assert_array_equal(result, expected, strict=True)
82+
assert_array_equal(result, expected)
8383

8484

8585
class TestArgwhere:
@@ -90,7 +90,7 @@ def test_basic(self, dt):
9090

9191
result = dpnp.argwhere(ia)
9292
expected = numpy.argwhere(a)
93-
assert_array_equal(result, expected, strict=True)
93+
assert_equal(result, expected)
9494

9595
@pytest.mark.parametrize("ndim", [0, 1, 2])
9696
def test_ndim(self, ndim):
@@ -103,7 +103,7 @@ def test_ndim(self, ndim):
103103

104104
result = dpnp.argwhere(ia)
105105
expected = numpy.argwhere(a)
106-
assert_array_equal(result, expected, strict=True)
106+
assert_equal(result, expected)
107107

108108
# only one
109109
a[...] = False
@@ -112,7 +112,7 @@ def test_ndim(self, ndim):
112112

113113
result = dpnp.argwhere(ia)
114114
expected = numpy.argwhere(a)
115-
assert_array_equal(result, expected, strict=True)
115+
assert_equal(result, expected)
116116

117117
# all but one
118118
a[...] = True
@@ -121,23 +121,23 @@ def test_ndim(self, ndim):
121121

122122
result = dpnp.argwhere(ia)
123123
expected = numpy.argwhere(a)
124-
assert_array_equal(result, expected, strict=True)
124+
assert_equal(result, expected)
125125

126126
# all
127127
a[...] = True
128128
ia = dpnp.array(a)
129129

130130
result = dpnp.argwhere(ia)
131131
expected = numpy.argwhere(a)
132-
assert_array_equal(result, expected, strict=True)
132+
assert_equal(result, expected)
133133

134134
def test_2d(self):
135135
a = numpy.arange(6).reshape((2, 3))
136136
ia = dpnp.array(a)
137137

138138
result = dpnp.argwhere(ia > 1)
139139
expected = numpy.argwhere(a > 1)
140-
assert_array_equal(result, expected, strict=True)
140+
assert_array_equal(result, expected)
141141

142142

143143
class TestWhere:
@@ -148,11 +148,11 @@ def test_basic(self, dtype):
148148

149149
expected = numpy.where(a, dtype(0), dtype(1))
150150
result = dpnp.where(ia, dtype(0), dtype(1))
151-
assert_array_equal(result, expected, strict=True)
151+
assert_array_equal(result, expected)
152152

153153
expected = numpy.where(~a, dtype(0), dtype(1))
154154
result = dpnp.where(~ia, dtype(0), dtype(1))
155-
assert_array_equal(result, expected, strict=True)
155+
assert_array_equal(result, expected)
156156

157157
d = numpy.ones_like(a).astype(dtype)
158158
e = numpy.zeros_like(d)
@@ -164,11 +164,11 @@ def test_basic(self, dtype):
164164

165165
expected = numpy.where(a, e, e)
166166
result = dpnp.where(ia, ie, ie)
167-
assert_array_equal(result, expected, strict=True)
167+
assert_array_equal(result, expected)
168168

169169
expected = numpy.where(a, d, e)
170170
result = dpnp.where(ia, id, ie)
171-
assert_array_equal(result, expected, strict=True)
171+
assert_array_equal(result, expected)
172172

173173
@pytest.mark.parametrize("dtype", get_all_dtypes(no_none=True))
174174
@pytest.mark.parametrize(
@@ -223,7 +223,7 @@ def test_strided(self, dtype, slice_a, slice_d, slice_e):
223223

224224
expected = numpy.where(a[slice_a], d[slice_d], e[slice_e])
225225
result = dpnp.where(ia[slice_a], id[slice_d], ie[slice_e])
226-
assert_array_equal(result, expected, strict=True)
226+
assert_array_equal(result, expected)
227227

228228
def test_zero_sized(self):
229229
a = numpy.array([], dtype=bool).reshape(0, 3)
@@ -234,7 +234,7 @@ def test_zero_sized(self):
234234

235235
expected = numpy.where(a, 0, b)
236236
result = dpnp.where(ia, 0, ib)
237-
assert_array_equal(result, expected, strict=True)
237+
assert_array_equal(result, expected)
238238

239239
def test_ndim(self):
240240
a = numpy.zeros((2, 25))
@@ -247,11 +247,11 @@ def test_ndim(self):
247247

248248
expected = numpy.where(c[:, numpy.newaxis], a, b)
249249
result = dpnp.where(ic[:, dpnp.newaxis], ia, ib)
250-
assert_dtype_allclose(result, expected)
250+
assert_array_equal(result, expected)
251251

252252
expected = numpy.where(c, a.T, b.T)
253253
result = dpnp.where(ic, ia.T, ib.T)
254-
assert_dtype_allclose(result, expected)
254+
assert_array_equal(result, expected)
255255

256256
def test_dtype_mix(self):
257257
a = numpy.uint32(1)
@@ -282,14 +282,14 @@ def test_dtype_mix(self):
282282

283283
expected = numpy.where(c, a, b)
284284
result = dpnp.where(ic, ia, ib)
285-
assert_dtype_allclose(result, expected)
285+
assert_array_equal(result, expected)
286286

287287
b = b.astype(numpy.int64)
288288
ib = dpnp.array(b)
289289

290290
expected = numpy.where(c, a, b)
291291
result = dpnp.where(ic, ia, ib)
292-
assert_array_equal(result, expected, strict=True)
292+
assert_array_equal(result, expected)
293293

294294
# non bool mask
295295
c = c.astype(int)
@@ -298,7 +298,7 @@ def test_dtype_mix(self):
298298

299299
expected = numpy.where(c, a, b)
300300
result = dpnp.where(ic, ia, ib)
301-
assert_array_equal(result, expected, strict=True)
301+
assert_array_equal(result, expected)
302302

303303
# invert
304304
tmpmask = c != 0
@@ -308,7 +308,7 @@ def test_dtype_mix(self):
308308

309309
expected = numpy.where(c, a, b)
310310
result = dpnp.where(ic, ia, ib)
311-
assert_array_equal(result, expected, strict=True)
311+
assert_array_equal(result, expected)
312312

313313
def test_error(self):
314314
c = dpnp.array([True, True])
@@ -323,7 +323,7 @@ def test_empty_result(self):
323323

324324
expected = numpy.vstack(numpy.where(a == 99.0))
325325
result = dpnp.vstack(dpnp.where(ia == 99.0))
326-
assert_array_equal(result, expected, strict=True)
326+
assert_array_equal(result, expected)
327327

328328
@pytest.mark.parametrize("x_dt", get_all_dtypes(no_none=True))
329329
@pytest.mark.parametrize("y_dt", get_all_dtypes(no_none=True))
@@ -340,7 +340,7 @@ def test_out(self, x_dt, y_dt):
340340

341341
result = dpnp.where(icond, ix, iy, out=iout)
342342
expected = numpy.where(cond, x, y)
343-
assert_dtype_allclose(result, expected)
343+
assert_array_equal(result, expected)
344344

345345
@pytest.mark.parametrize("order", ["C", "F", "A", "K", None])
346346
def test_order(self, order):
@@ -354,7 +354,7 @@ def test_order(self, order):
354354

355355
result = dpnp.where(icond, ix, iy, order=order)
356356
expected = numpy.where(cond, x, y)
357-
assert_array_equal(result, expected, strict=True)
357+
assert_array_equal(result, expected)
358358

359359
if order == "F":
360360
assert result.flags.f_contiguous

dpnp/tests/test_special.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import math
22

33
import numpy
4+
from numpy.testing import assert_allclose
45

56
import dpnp
67

7-
from .helper import assert_dtype_allclose
8-
98

109
def test_erf():
1110
a = numpy.linspace(2.0, 3.0, num=10)
@@ -17,7 +16,7 @@ def test_erf():
1716

1817
result = dpnp.erf(ia)
1918

20-
assert_dtype_allclose(result, expected)
19+
assert_allclose(result, expected)
2120

2221

2322
def test_erf_fallback():
@@ -30,4 +29,4 @@ def test_erf_fallback():
3029

3130
result = dpnp.erf(dpa)
3231

33-
assert_dtype_allclose(result, expected)
32+
assert_allclose(result, expected)

0 commit comments

Comments
 (0)