Skip to content

Commit bb703b8

Browse files
Review comments
1 parent 80fd7c5 commit bb703b8

File tree

6 files changed

+61
-28
lines changed

6 files changed

+61
-28
lines changed

.github/workflows/conda-package.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,15 @@ jobs:
173173
python -c "import dpnp; print(dpnp.__version__)"
174174
175175
- name: Run tests
176+
env:
177+
DPNP_TEST_ALL_TYPES: 1
176178
if: env.RERUN_TESTS_ON_FAILURE != 'true'
177179
run: |
178-
export DPNP_TEST_ALL_TYPES=1
179180
python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
180181
181182
- name: Run tests
183+
env:
184+
DPNP_TEST_ALL_TYPES: 1
182185
if: env.RERUN_TESTS_ON_FAILURE == 'true'
183186
id: run_tests_linux
184187
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
@@ -191,7 +194,6 @@ jobs:
191194
. $CONDA/etc/profile.d/mamba.sh
192195
mamba activate ${{ env.TEST_ENV_NAME }}
193196
194-
export DPNP_TEST_ALL_TYPES=1
195197
python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
196198
197199
test_windows:
@@ -311,12 +313,15 @@ jobs:
311313
python -c "import dpnp; print(dpnp.__version__)"
312314
313315
- name: Run tests
316+
env:
317+
DPNP_TEST_ALL_TYPES: 1
314318
if: env.RERUN_TESTS_ON_FAILURE != 'true'
315319
run: |
316-
set DPNP_TEST_ALL_TYPES=1
317320
pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
318321
319322
- name: Run tests
323+
env:
324+
DPNP_TEST_ALL_TYPES: 1
320325
if: env.RERUN_TESTS_ON_FAILURE == 'true'
321326
id: run_tests_win
322327
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
@@ -325,7 +330,6 @@ jobs:
325330
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
326331
retry_on: any
327332
command: |
328-
set DPNP_TEST_ALL_TYPES=1
329333
python -m pytest -n auto -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
330334
331335
upload:

doc/reference/dtypes_table.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,35 @@ Table below shows a list of all supported data types (dtypes) and constants of t
1313
- Constants
1414
* -
1515
- :obj:`bool <numpy.bool_>`
16+
- :obj:`int8 <numpy.int8>`
17+
- :obj:`int16 <numpy.int16>`
1618
- :obj:`int32 <numpy.int32>`
1719
- :obj:`int64 <numpy.int64>`
20+
- :obj:`uint8 <numpy.uint8>`
21+
- :obj:`uint16 <numpy.uint16>`
22+
- :obj:`uint32 <numpy.uint32>`
23+
- :obj:`uint64 <numpy.uint64>`
1824
- :obj:`float32 <numpy.float32>`
1925
- :obj:`float64 <numpy.float64>`
2026
- :obj:`complex64 <numpy.complex64>`
2127
- :obj:`complex128 <numpy.complex128>`
2228
-
2329
- :obj:`bool_ <numpy.bool_>`
30+
- :obj:`byte <numpy.byte>`
2431
- :obj:`cdouble <numpy.cdouble>`
2532
- :obj:`csingle <numpy.csingle>`
2633
- :obj:`double <numpy.double>`
2734
- :obj:`float16 <numpy.float16>`
28-
- :obj:`int <numpy.int>`
2935
- :obj:`int_ <numpy.int_>`
3036
- :obj:`intc <numpy.intc>`
37+
- :obj:`intp <numpy.intp>`
38+
- :obj:`longlong <numpy.longlong>`
3139
- :obj:`single <numpy.single>`
40+
- :obj:`ubyte <numpy.ubyte>`
41+
- :obj:`uintc <numpy.uintc>`
42+
- :obj:`uintp <numpy.uintp>`
43+
- :obj:`ushort <numpy.ushort>`
44+
- :obj:`ulonglong <numpy.ulonglong>`
3245
-
3346
- :obj:`e <numpy.e>`
3447
- :obj:`euler_gamma <numpy.euler_gamma>`

dpnp/dpnp_iface_types.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
__all__ = [
4141
"bool",
4242
"bool_",
43+
"byte",
4344
"cdouble",
4445
"complex128",
4546
"complex64",
@@ -57,27 +58,34 @@
5758
"iinfo",
5859
"inexact",
5960
"inf",
60-
"int",
6161
"int_",
6262
"int8",
6363
"int16",
6464
"int32",
6565
"int64",
66-
"uint8",
67-
"uint16",
68-
"uint32",
69-
"uint64",
7066
"integer",
7167
"intc",
7268
"intp",
7369
"issubdtype",
7470
"is_type_supported",
71+
"longlong",
7572
"nan",
7673
"newaxis",
7774
"number",
7875
"pi",
76+
"short",
7977
"signedinteger",
8078
"single",
79+
"ubyte",
80+
"uint8",
81+
"uint16",
82+
"uint32",
83+
"uint64",
84+
"uintc",
85+
"uintp",
86+
"unsignedinteger",
87+
"ushort",
88+
"ulonglong",
8189
]
8290

8391

@@ -87,6 +95,7 @@
8795
# =============================================================================
8896
bool = numpy.bool_
8997
bool_ = numpy.bool_
98+
byte = numpy.byte
9099
cdouble = numpy.cdouble
91100
complex128 = numpy.complex128
92101
complex64 = numpy.complex64
@@ -99,22 +108,29 @@
99108
float64 = numpy.float64
100109
floating = numpy.floating
101110
inexact = numpy.inexact
102-
int = numpy.int_
103111
int_ = numpy.int_
104112
int8 = numpy.int8
105113
int16 = numpy.int16
106114
int32 = numpy.int32
107115
int64 = numpy.int64
108-
uint8 = numpy.uint8
109-
uint16 = numpy.uint16
110-
uint32 = numpy.uint32
111-
uint64 = numpy.uint64
112116
integer = numpy.integer
113117
intc = numpy.intc
114118
intp = numpy.intp
119+
longlong = numpy.longlong
115120
number = numpy.number
121+
short = numpy.short
116122
signedinteger = numpy.signedinteger
117123
single = numpy.single
124+
ubyte = numpy.ubyte
125+
uint8 = numpy.uint8
126+
uint16 = numpy.uint16
127+
uint32 = numpy.uint32
128+
uint64 = numpy.uint64
129+
uintc = numpy.uintc
130+
uintp = numpy.uintp
131+
unsignedinteger = numpy.unsignedinteger
132+
ushort = numpy.ushort
133+
ulonglong = numpy.ulonglong
118134

119135

120136
# =============================================================================

dpnp/tests/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import os
22

3-
all_types = int(os.getenv("DPNP_TEST_ALL_TYPES", 0))
3+
all_types = int(os.getenv("DPNP_TEST_ALL_TYPES", 0))

dpnp/tests/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from numpy.testing import assert_allclose, assert_array_equal
66

77
import dpnp
8-
from tests import config
8+
from dpnp.tests import config
99

1010

1111
def assert_dtype_allclose(

dpnp/tests/test_random_state.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def test_fallback(self, loc, scale):
241241
float,
242242
dpnp.int64,
243243
dpnp.int32,
244-
dpnp.int,
244+
dpnp.int_,
245245
int,
246246
numpy.clongdouble,
247247
dpnp.complex128,
@@ -254,7 +254,7 @@ def test_fallback(self, loc, scale):
254254
"float",
255255
"dpnp.int64",
256256
"dpnp.int32",
257-
"dpnp.int",
257+
"dpnp.int_",
258258
"int",
259259
"numpy.clongdouble",
260260
"dpnp.complex128",
@@ -364,8 +364,8 @@ def test_wrong_dims(self):
364364
class TestRandInt:
365365
@pytest.mark.parametrize(
366366
"dtype",
367-
[int, dpnp.int32, dpnp.int],
368-
ids=["int", "dpnp.int32", "dpnp.int"],
367+
[int, dpnp.int32, dpnp.int_],
368+
ids=["int", "dpnp.int32", "dpnp.int_"],
369369
)
370370
@pytest.mark.parametrize(
371371
"usm_type",
@@ -377,7 +377,7 @@ def test_distr(self, dtype, usm_type):
377377
low = 1
378378
high = 10
379379

380-
if dtype == dpnp.int and dtype != dpnp.dtype("int32"):
380+
if dtype == dpnp.int_ and dtype != dpnp.dtype("int32"):
381381
pytest.skip(
382382
"dtype isn't alias on dpnp.int32 on the target OS, so there will be a fallback"
383383
)
@@ -564,10 +564,10 @@ def test_bounds_fallback(self, low, high):
564564
@pytest.mark.usefixtures("allow_fall_back_on_numpy")
565565
@pytest.mark.parametrize(
566566
"dtype",
567-
[dpnp.int64, dpnp.int, dpnp.bool, dpnp.bool_, bool],
567+
[dpnp.int64, dpnp.int_, dpnp.bool, dpnp.bool_, bool],
568568
ids=[
569569
"dpnp.int64",
570-
"dpnp.int",
570+
"dpnp.int_",
571571
"dpnp.bool",
572572
"dpnp.bool_",
573573
"bool",
@@ -579,7 +579,7 @@ def test_dtype_fallback(self, dtype):
579579
high = 37 if not dtype in {dpnp.bool_, bool} else 2
580580
size = (3, 2, 5)
581581

582-
if dtype == dpnp.int and dtype == dpnp.dtype("int32"):
582+
if dtype == dpnp.int_ and dtype == dpnp.dtype("int32"):
583583
pytest.skip(
584584
"dtype is alias on dpnp.int32 on the target OS, so no fallback here"
585585
)
@@ -1155,7 +1155,7 @@ def test_fallback(self, low, high):
11551155
dpnp.float16,
11561156
float,
11571157
dpnp.int64,
1158-
dpnp.int,
1158+
dpnp.int_,
11591159
int,
11601160
numpy.clongdouble,
11611161
dpnp.complex128,
@@ -1167,7 +1167,7 @@ def test_fallback(self, low, high):
11671167
"dpnp.float16",
11681168
"float",
11691169
"dpnp.int64",
1170-
"dpnp.int",
1170+
"dpnp.int_",
11711171
"int",
11721172
"numpy.clongdouble",
11731173
"dpnp.complex128",
@@ -1177,7 +1177,7 @@ def test_fallback(self, low, high):
11771177
],
11781178
)
11791179
def test_invalid_dtype(self, dtype):
1180-
if dtype == dpnp.int and dtype == dpnp.dtype("int32"):
1180+
if dtype == dpnp.int_ and dtype == dpnp.dtype("int32"):
11811181
pytest.skip(
11821182
"dtype is alias on dpnp.int32 on the target OS, so no error here"
11831183
)

0 commit comments

Comments
 (0)