Skip to content

Commit 43e66cc

Browse files
committed
address comments
1 parent 3b4a35c commit 43e66cc

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

dpnp/dpnp_algo/dpnp_elementwise_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ def dpnp_greater_equal(x1, x2, out=None, order="K"):
12791279
dpnp.ndarray:
12801280
An array containing the element-wise imaginary component of input.
12811281
If the input is a real-valued data type, the returned array has
1282-
the same datat type. If the input is a complex floating-point
1282+
the same data type. If the input is a complex floating-point
12831283
data type, the returned array has a floating-point data type
12841284
with the same floating-point precision as complex input.
12851285
"""
@@ -2081,7 +2081,7 @@ def dpnp_proj(x, out=None, order="K"):
20812081
dpnp.ndarray:
20822082
An array containing the element-wise real component of input.
20832083
If the input is a real-valued data type, the returned array has
2084-
the same datat type. If the input is a complex floating-point
2084+
the same data type. If the input is a complex floating-point
20852085
data type, the returned array has a floating-point data type
20862086
with the same floating-point precision as complex input.
20872087
"""

dpnp/dpnp_array.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,8 @@ def imag(self):
832832
>>> import dpnp as np
833833
>>> x = np.sqrt(np.array([1+0j, 0+1j]))
834834
>>> x.imag
835-
array([ 0. , 0.70710678])
835+
array([0. , 0.70710677])
836+
836837
"""
837838
return dpnp.imag(self)
838839

@@ -841,7 +842,7 @@ def imag(self, value):
841842
if dpnp.issubsctype(self.dtype, dpnp.complexfloating):
842843
dpnp.copyto(self._array_obj.imag, value)
843844
else:
844-
raise TypeError("dpnp.ndarray does not have imaginary part to set")
845+
raise TypeError("array does not have imaginary part to set")
845846

846847
def item(self, id=None):
847848
"""
@@ -1010,7 +1011,8 @@ def real(self):
10101011
>>> import dpnp as np
10111012
>>> x = np.sqrt(np.array([1+0j, 0+1j]))
10121013
>>> x.real
1013-
array([ 1. , 0.70710678])
1014+
array([1. , 0.70710677])
1015+
10141016
"""
10151017
if dpnp.issubsctype(self.dtype, dpnp.complexfloating):
10161018
return dpnp.real(self)

dpnp/dpnp_iface_mathematical.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,12 +1206,14 @@ def imag(
12061206
>>> import dpnp as np
12071207
>>> a = np.array([1+2j, 3+4j, 5+6j])
12081208
>>> a.imag
1209-
array([2., 4., 6.])
1209+
array([2., 4., 6.])
1210+
12101211
>>> a.imag = np.array([8, 10, 12])
12111212
>>> a
1212-
array([1.+8.j, 3.+10.j, 5.+12.j])
1213+
array([1. +8.j, 3.+10.j, 5.+12.j])
1214+
12131215
>>> np.imag(np.array(1 + 1j))
1214-
array(1.0)
1216+
array(1.)
12151217
12161218
"""
12171219

@@ -2000,6 +2002,7 @@ def proj(
20002002
20012003
>>> np.proj(np.array([complex(1,np.inf), complex(1,-np.inf), complex(np.inf,-1),]))
20022004
array([inf+0.j, inf-0.j, inf-0.j])
2005+
20032006
"""
20042007

20052008
return check_nd_call_func(
@@ -2055,13 +2058,16 @@ def real(
20552058
>>> import dpnp as np
20562059
>>> a = np.array([1+2j, 3+4j, 5+6j])
20572060
>>> a.real
2058-
array([1., 3., 5.])
2061+
array([1., 3., 5.])
2062+
20592063
>>> a.real = 9
20602064
>>> a
2061-
array([9.+2.j, 9.+4.j, 9.+6.j])
2065+
array([9.+2.j, 9.+4.j, 9.+6.j])
2066+
20622067
>>> a.real = np.array([9, 8, 7])
20632068
>>> a
2064-
array([9.+2.j, 8.+4.j, 7.+6.j])
2069+
array([9.+2.j, 8.+4.j, 7.+6.j])
2070+
20652071
>>> np.real(np.array(1 + 1j))
20662072
array(1.)
20672073

0 commit comments

Comments
 (0)