Skip to content

Commit 6badbb5

Browse files
authored
rename function to container_copy (#856)
1 parent 7dbc689 commit 6badbb5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dpnp/dpnp_algo/dpnp_algo.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ cpdef utils.dpnp_descriptor dpnp_array(object obj, object dtype=None):
118118
else:
119119
result = utils_py.create_output_descriptor_py(obj_shape, elem_dtype, None)
120120

121-
utils.copy_values_to_dparray(result.get_pyobj(), obj)
121+
utils.container_copy(result.get_pyobj(), obj)
122122

123123
return result
124124

dpnp/dpnp_utils/dpnp_algo_utils.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ cpdef find_common_type(object x1_obj, object x2_obj)
9999
Find common type of 2 input objects
100100
"""
101101

102-
cdef long copy_values_to_dparray(dparray dst, input_obj, size_t dst_idx=*) except -1
102+
cdef long container_copy(dparray dst, input_obj, size_t dst_idx=*) except -1
103103
"""
104104
Copy values to `dst` by iterating element by element in `input_obj`
105105
"""

dpnp/dpnp_utils/dpnp_algo_utils.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ cpdef dp2nd_array(arr):
175175
"""Convert dparray to ndarray"""
176176
return dpnp.asnumpy(arr) if isinstance(arr, dparray) else arr
177177

178-
cdef long copy_values_to_dparray(dparray dst, input_obj, size_t dst_idx=0) except -1:
178+
cdef long container_copy(dparray dst, input_obj, size_t dst_idx=0) except -1:
179179
cdef elem_dtype = dst.dtype
180180

181181
for elem_value in input_obj:
182182
if isinstance(elem_value, (list, tuple)):
183-
dst_idx = copy_values_to_dparray(dst, elem_value, dst_idx)
183+
dst_idx = container_copy(dst, elem_value, dst_idx)
184184
elif issubclass(type(elem_value), (numpy.ndarray, dparray)):
185-
dst_idx = copy_values_to_dparray(dst, elem_value, dst_idx)
185+
dst_idx = container_copy(dst, elem_value, dst_idx)
186186
else:
187187
if elem_dtype == numpy.float64:
188188
( < double * > dst.get_data())[dst_idx] = elem_value
@@ -199,7 +199,7 @@ cdef long copy_values_to_dparray(dparray dst, input_obj, size_t dst_idx=0) excep
199199
elif elem_dtype == numpy.complex128:
200200
(< cpp_complex[double] * > dst.get_data())[dst_idx] = elem_value
201201
else:
202-
checker_throw_type_error("copy_values_to_dparray", elem_dtype)
202+
checker_throw_type_error("container_copy", elem_dtype)
203203

204204
dst_idx += 1
205205

0 commit comments

Comments
 (0)