Skip to content

Commit 4c903f6

Browse files
authored
Merge branch 'master' into use_dpctl_arange
2 parents a756529 + a731718 commit 4c903f6

File tree

1 file changed

+63
-3
lines changed

1 file changed

+63
-3
lines changed

dpnp/dparray.pyx

Lines changed: 63 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# cython: language_level=3
22
# -*- coding: utf-8 -*-
33
# *****************************************************************************
4-
# Copyright (c) 2016-2020, Intel Corporation
4+
# Copyright (c) 2016-2022, Intel Corporation
55
# All rights reserved.
66
#
77
# Redistribution and use in source and binary forms, with or without
@@ -33,23 +33,77 @@ using USB interface for an Intel GPU device.
3333
3434
"""
3535

36+
import warnings
3637

3738
from libcpp cimport bool as cpp_bool
3839

3940
from dpnp.dpnp_iface_types import *
40-
from dpnp.dpnp_iface import *
41+
42+
# It's prohibeted to use 'import *' from 'dpnp.dpnp_iface_arraycreation' module here,
43+
# because module has 'array' function, but cython has already imported 'array' by default.
44+
# It would cause import collision. Thus instead import each function explicitly.
45+
from dpnp.dpnp_iface_arraycreation import (
46+
arange,
47+
array,
48+
asanyarray,
49+
asarray,
50+
ascontiguousarray,
51+
copy,
52+
diag,
53+
diagflat,
54+
empty,
55+
empty_like,
56+
eye,
57+
frombuffer,
58+
fromfile,
59+
fromfunction,
60+
fromiter,
61+
fromstring,
62+
full,
63+
full_like,
64+
geomspace,
65+
identity,
66+
linspace,
67+
loadtxt,
68+
logspace,
69+
meshgrid,
70+
mgrid,
71+
ogrid,
72+
ones,
73+
ones_like,
74+
ptp,
75+
trace,
76+
tri,
77+
tril,
78+
triu,
79+
vander,
80+
zeros,
81+
zeros_like
82+
)
83+
from dpnp.dpnp_iface_bitwise import *
84+
from dpnp.dpnp_iface_counting import *
85+
from dpnp.dpnp_iface_indexing import *
86+
from dpnp.dpnp_iface_libmath import *
87+
from dpnp.dpnp_iface_linearalgebra import *
88+
from dpnp.dpnp_iface_logic import *
89+
from dpnp.dpnp_iface_manipulation import *
90+
from dpnp.dpnp_iface_mathematical import *
91+
from dpnp.dpnp_iface_searching import *
92+
from dpnp.dpnp_iface_sorting import *
93+
from dpnp.dpnp_iface_statistics import *
94+
from dpnp.dpnp_iface_trigonometric import *
4195

4296
# to avoid interference with Python internal functions
4397
from dpnp.dpnp_iface import sum as iface_sum
4498
from dpnp.dpnp_iface import prod as iface_prod
4599
from dpnp.dpnp_iface import get_dpnp_descriptor as iface_get_dpnp_descriptor
46100

47-
from dpnp.dpnp_algo cimport *
48101
from dpnp.dpnp_iface_statistics import min, max # TODO do the same as for iface_sum
49102
from dpnp.dpnp_iface_logic import all, any # TODO do the same as for iface_sum
50103
import numpy
51104
cimport numpy
52105

106+
from dpnp.dpnp_algo cimport *
53107
cimport dpnp.dpnp_utils as utils
54108

55109

@@ -124,6 +178,12 @@ cdef class dparray:
124178

125179
"""
126180
181+
with warnings.catch_warnings():
182+
warnings.filterwarnings("default", category=DeprecationWarning)
183+
warnings.warn("dpnp.dparray class is deprecated, use dpnp.dpnp_array class instead",
184+
DeprecationWarning,
185+
stacklevel=2)
186+
127187
def __init__(self, shape, dtype=float64, memptr=None, strides=None, order=b'C'):
128188
cdef Py_ssize_t shape_it = 0
129189
cdef Py_ssize_t strides_it = 0

0 commit comments

Comments
 (0)