Skip to content

Commit 3f7ec15

Browse files
committed
Add a space after comma
1 parent b89e5aa commit 3f7ec15

12 files changed

+42
-42
lines changed

dpnp/backend/extensions/lapack/gesvd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ static sycl::event gesvd_impl(sycl::queue &exec_q,
9595
exec_q,
9696
jobu, // Character specifying how to compute the matrix U:
9797
// 'A' computes all columns of U,
98-
// 'S' computes the first min(m,n) columns of U,
98+
// 'S' computes the first min(m, n) columns of U,
9999
// 'O' overwrites A with the columns of U,
100100
// 'N' does not compute U.
101101
jobvt, // Character specifying how to compute the matrix VT:
102102
// 'A' computes all rows of VT,
103-
// 'S' computes the first min(m,n) rows of VT,
103+
// 'S' computes the first min(m, n) rows of VT,
104104
// 'O' overwrites A with the rows of VT,
105105
// 'N' does not compute VT.
106106
m, // The number of rows in the input matrix A (0 <= m).

dpnp/backend/extensions/lapack/gesvd_batch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ static sycl::event gesvd_batch_impl(sycl::queue &exec_q,
147147
exec_q,
148148
jobu, // Character specifying how to compute the matrix U:
149149
// 'A' computes all columns of U,
150-
// 'S' computes the first min(m,n) columns of U,
150+
// 'S' computes the first min(m, n) columns of U,
151151
// 'O' overwrites A with the columns of U,
152152
// 'N' does not compute U.
153153
jobvt, // Character specifying how to compute the matrix VT:
154154
// 'A' computes all rows of VT,
155-
// 'S' computes the first min(m,n) rows of VT,
155+
// 'S' computes the first min(m, n) rows of VT,
156156
// 'O' overwrites A with the rows of VT,
157157
// 'N' does not compute VT.
158158
m, // The number of rows in the input batch matrix A (0 <= m).

dpnp/dpnp_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ def diagonal(self, offset=0, axis1=0, axis2=1):
10291029
Examples
10301030
--------
10311031
>>> import dpnp as np
1032-
>>> a = np.arange(4).reshape(2,2)
1032+
>>> a = np.arange(4).reshape(2, 2)
10331033
>>> a.diagonal()
10341034
array([0, 3])
10351035

dpnp/dpnp_iface_arraycreation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,7 +3127,7 @@ def meshgrid(*xi, copy=True, sparse=False, indexing="xy"):
31273127
>>> y = np.arange(-5, 5, 0.1)
31283128
>>> xx, yy = np.meshgrid(x, y, sparse=True)
31293129
>>> z = np.sin(xx**2 + yy**2) / (xx**2 + yy**2)
3130-
>>> h = plt.contourf(x,y,z)
3130+
>>> h = plt.contourf(x, y, z)
31313131
>>> plt.show()
31323132
31333133
"""
@@ -3202,7 +3202,7 @@ class MGridClass:
32023202
Examples
32033203
--------
32043204
>>> import dpnp as np
3205-
>>> np.mgrid[0:5,0:5]
3205+
>>> np.mgrid[0:5, 0:5]
32063206
array([[[0, 0, 0, 0, 0],
32073207
[1, 1, 1, 1, 1],
32083208
[2, 2, 2, 2, 2],

dpnp/dpnp_iface_histograms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ def histogram2d(x, y, bins=10, range=None, density=None, weights=None):
803803
is the number of bins and array is the bin edges.
804804
805805
Default: ``10``.
806-
range : {None, dpnp.ndarray, usm_ndarray} of shape (2,2), optional
806+
range : {None, dpnp.ndarray, usm_ndarray} of shape (2, 2), optional
807807
The leftmost and rightmost edges of the bins along each dimension
808808
If ``None`` the ranges are
809809
``[[x.min(), x.max()], [y.min(), y.max()]]``. All values outside

dpnp/dpnp_iface_indexing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def diagonal(a, offset=0, axis1=0, axis2=1):
665665
Examples
666666
--------
667667
>>> import dpnp as np
668-
>>> a = np.arange(4).reshape(2,2)
668+
>>> a = np.arange(4).reshape(2, 2)
669669
>>> a
670670
array([[0, 1],
671671
[2, 3]])
@@ -676,7 +676,7 @@ def diagonal(a, offset=0, axis1=0, axis2=1):
676676
677677
A 3-D example:
678678
679-
>>> a = np.arange(8).reshape(2,2,2)
679+
>>> a = np.arange(8).reshape(2, 2, 2)
680680
>>> a
681681
array([[[0, 1],
682682
[2, 3]],
@@ -1234,8 +1234,8 @@ def ix_(*args):
12341234
N dimensions.
12351235
12361236
Using :obj:`dpnp.ix_` one can quickly construct index arrays that will
1237-
index the cross product. ``a[dpnp.ix_([1,3],[2,5])]`` returns the array
1238-
``[[a[1,2] a[1,5]], [a[3,2] a[3,5]]]``.
1237+
index the cross product. ``a[dpnp.ix_([1, 3],[2, 5])]`` returns the array
1238+
``[[a[1, 2] a[1, 5]], [a[3, 2] a[3, 5]]]``.
12391239
12401240
Parameters
12411241
----------

dpnp/dpnp_iface_manipulation.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ def atleast_1d(*arys):
944944
>>> np.atleast_1d(x, y)
945945
[array([1.]), array([3, 4])]
946946
947-
>>> x = np.arange(9.0).reshape(3,3)
947+
>>> x = np.arange(9.0).reshape(3, 3)
948948
>>> np.atleast_1d(x)
949949
array([[0., 1., 2.],
950950
[3., 4., 5.],
@@ -3342,7 +3342,7 @@ def rollaxis(x, axis, start=0):
33423342
Examples
33433343
--------
33443344
>>> import dpnp as np
3345-
>>> a = np.ones((3,4,5,6))
3345+
>>> a = np.ones((3, 4, 5, 6))
33463346
>>> np.rollaxis(a, 3, 1).shape
33473347
(3, 6, 4, 5)
33483348
>>> np.rollaxis(a, 2).shape
@@ -3405,11 +3405,11 @@ def rot90(m, k=1, axes=(0, 1)):
34053405
34063406
Notes
34073407
-----
3408-
``rot90(m, k=1, axes=(1,0))`` is the reverse of
3409-
``rot90(m, k=1, axes=(0,1))``.
3408+
``rot90(m, k=1, axes=(1, 0))`` is the reverse of
3409+
``rot90(m, k=1, axes=(0, 1))``.
34103410
3411-
``rot90(m, k=1, axes=(1,0))`` is equivalent to
3412-
``rot90(m, k=-1, axes=(0,1))``.
3411+
``rot90(m, k=1, axes=(1, 0))`` is equivalent to
3412+
``rot90(m, k=-1, axes=(0, 1))``.
34133413
34143414
Examples
34153415
--------
@@ -3837,13 +3837,13 @@ def swapaxes(a, axis1, axis2):
38373837
[2],
38383838
[3]])
38393839
3840-
>>> x = np.array([[[0,1],[2,3]],[[4,5],[6,7]]])
3840+
>>> x = np.array([[[0, 1],[2, 3]],[[4, 5],[6, 7]]])
38413841
>>> x
38423842
array([[[0, 1],
38433843
[2, 3]],
38443844
[[4, 5],
38453845
[6, 7]]])
3846-
>>> np.swapaxes(x,0,2)
3846+
>>> np.swapaxes(x, 0, 2)
38473847
array([[[0, 4],
38483848
[2, 6]],
38493849
[[1, 5],

dpnp/dpnp_iface_statistics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ def corrcoef(x, y=None, rowvar=True, *, dtype=None):
472472
out /= stddev[None, :]
473473

474474
# Clip real and imaginary parts to [-1, 1]. This does not guarantee
475-
# abs(a[i,j]) <= 1 for complex arrays, but is the best we can do without
475+
# abs(a[i, j]) <= 1 for complex arrays, but is the best we can do without
476476
# excessive work.
477477
dpnp.clip(out.real, -1, 1, out=out.real)
478478
if dpnp.iscomplexobj(out):
@@ -851,7 +851,7 @@ def cov(
851851
array([[ 1., -1.],
852852
[-1., 1.]])
853853
854-
Note that element :math:`C_{0,1}`, which shows the correlation between
854+
Note that element :math:`C_{0, 1}`, which shows the correlation between
855855
:math:`x_0` and :math:`x_1`, is negative.
856856
857857
Further, note how `x` and `y` are combined:
@@ -974,7 +974,7 @@ def max(a, axis=None, out=None, keepdims=False, initial=None, where=True):
974974
Examples
975975
--------
976976
>>> import dpnp as np
977-
>>> a = np.arange(4).reshape((2,2))
977+
>>> a = np.arange(4).reshape((2, 2))
978978
>>> a
979979
array([[0, 1],
980980
[2, 3]])
@@ -1251,7 +1251,7 @@ def min(a, axis=None, out=None, keepdims=False, initial=None, where=True):
12511251
Examples
12521252
--------
12531253
>>> import dpnp as np
1254-
>>> a = np.arange(4).reshape((2,2))
1254+
>>> a = np.arange(4).reshape((2, 2))
12551255
>>> a
12561256
array([[0, 1],
12571257
[2, 3]])

dpnp/linalg/dpnp_iface_linalg.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ def diagonal(x, /, *, offset=0):
364364
365365
Parameters
366366
----------
367-
x : (...,M,N) {dpnp.ndarray, usm_ndarray}
367+
x : (..., M, N) {dpnp.ndarray, usm_ndarray}
368368
Input array having shape (..., M, N) and whose innermost two
369369
dimensions form ``MxN`` matrices.
370370
offset : int, optional
@@ -379,7 +379,7 @@ def diagonal(x, /, *, offset=0):
379379
380380
Returns
381381
-------
382-
out : (...,min(N,M)) dpnp.ndarray
382+
out : (...,min(N, M)) dpnp.ndarray
383383
An array containing the diagonals and whose shape is determined by
384384
removing the last two dimensions and appending a dimension equal to
385385
the size of the resulting diagonals. The returned array must have
@@ -393,15 +393,15 @@ def diagonal(x, /, *, offset=0):
393393
Examples
394394
--------
395395
>>> import dpnp as np
396-
>>> a = np.arange(4).reshape(2,2); a
396+
>>> a = np.arange(4).reshape(2, 2); a
397397
array([[0, 1],
398398
[2, 3]])
399399
>>> np.linalg.diagonal(a)
400400
array([0, 3])
401401
402402
A 3-D example:
403403
404-
>>> a = np.arange(8).reshape(2,2,2); a
404+
>>> a = np.arange(8).reshape(2, 2, 2); a
405405
array([[[0, 1],
406406
[2, 3]],
407407
[[4, 5],
@@ -673,7 +673,7 @@ def eigvals(a):
673673
Now multiply a diagonal matrix by ``Q`` on one side and by ``Q.T`` on the
674674
other:
675675
676-
>>> D = np.diag((-1,1))
676+
>>> D = np.diag((-1, 1))
677677
>>> LA.eigvals(D)
678678
array([-1., 1.])
679679
>>> A = np.dot(Q, D)
@@ -929,7 +929,7 @@ def matmul(x1, x2, /):
929929
930930
>>> a = np.arange(2 * 2 * 4).reshape((2, 2, 4))
931931
>>> b = np.arange(2 * 2 * 4).reshape((2, 4, 2))
932-
>>> np.linalg.matmul(a,b).shape
932+
>>> np.linalg.matmul(a, b).shape
933933
(2, 2, 2)
934934
>>> np.linalg.matmul(a, b)[0, 1, 1]
935935
array(98)
@@ -1333,7 +1333,7 @@ def norm(x, ord=None, axis=None, keepdims=False):
13331333
13341334
The Frobenius norm is given by [1]_:
13351335
1336-
:math:`||A||_F = [\sum_{i,j} abs(a_{i,j})^2]^{1/2}`
1336+
:math:`||A||_F = [\sum_{i, j} abs(a_{i, j})^2]^{1/2}`
13371337
13381338
The nuclear norm is the sum of the singular values.
13391339
@@ -1407,8 +1407,8 @@ def norm(x, ord=None, axis=None, keepdims=False):
14071407
14081408
Using the `axis` argument to compute matrix norms:
14091409
1410-
>>> m = np.arange(8).reshape(2,2,2)
1411-
>>> np.linalg.norm(m, axis=(1,2))
1410+
>>> m = np.arange(8).reshape(2, 2, 2)
1411+
>>> np.linalg.norm(m, axis=(1, 2))
14121412
array([ 3.74165739, 11.22497216])
14131413
>>> np.linalg.norm(m[0, :, :]), np.linalg.norm(m[1, :, :])
14141414
(array(3.74165739), array(11.22497216))
@@ -2004,9 +2004,9 @@ def tensordot(a, b, /, *, axes=2):
20042004
>>> np.linalg.tensordot(a, b, axes=1)
20052005
array([14, 32, 50])
20062006
2007-
>>> a = np.arange(60.).reshape(3,4,5)
2008-
>>> b = np.arange(24.).reshape(4,3,2)
2009-
>>> c = np.linalg.tensordot(a,b, axes=([1,0],[0,1]))
2007+
>>> a = np.arange(60.).reshape(3, 4, 5)
2008+
>>> b = np.arange(24.).reshape(4, 3, 2)
2009+
>>> c = np.linalg.tensordot(a, b, axes=([1, 0], [0, 1]))
20102010
>>> c.shape
20112011
(5, 2)
20122012
>>> c
@@ -2018,12 +2018,12 @@ def tensordot(a, b, /, *, axes=2):
20182018
20192019
A slower but equivalent way of computing the same...
20202020
2021-
>>> d = np.zeros((5,2))
2021+
>>> d = np.zeros((5, 2))
20222022
>>> for i in range(5):
20232023
... for j in range(2):
20242024
... for k in range(3):
20252025
... for n in range(4):
2026-
... d[i,j] += a[k,n,i] * b[n,k,j]
2026+
... d[i, j] += a[k, n, i] * b[n, k, j]
20272027
>>> c == d
20282028
array([[ True, True],
20292029
[ True, True],
@@ -2183,7 +2183,7 @@ def trace(x, /, *, offset=0, dtype=None):
21832183
21842184
Parameters
21852185
----------
2186-
x : (...,M,N) {dpnp.ndarray, usm_ndarray}
2186+
x : (..., M, N) {dpnp.ndarray, usm_ndarray}
21872187
Input array having shape (..., M, N) and whose innermost two
21882188
dimensions form ``MxN`` matrices.
21892189
offset : int, optional

dpnp/linalg/dpnp_utils_linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ def _multi_dot_matrix_chain_order(n, arrays, return_costs=False):
11091109
else [arrays[-1].shape[0], arrays[-1].shape[1]]
11101110
)
11111111
# m is a matrix of costs of the subproblems
1112-
# m[i,j]: min number of scalar multiplications needed to compute A_{i..j}
1112+
# m[i, j]: min number of scalar multiplications needed to compute A_{i..j}
11131113
m = dpnp.zeros((n, n), usm_type=usm_type, sycl_queue=exec_q)
11141114
# s is the actual ordering
11151115
# s[i, j] is the value of k at which we split the product A_i..A_j

dpnp/random/dpnp_iface_random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def chisquare(df, size=None):
242242
243243
Examples
244244
--------
245-
>>> dpnp.random.chisquare(2,4)
245+
>>> dpnp.random.chisquare(2, 4)
246246
array([ 1.89920014, 9.00867716, 3.13710533, 5.62318272]) # random
247247
248248
"""

dpnp/tests/test_arraycreation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def test_triu_size_null(k):
533533
def test_vander(array, dtype, n, increase):
534534
if dtype in [dpnp.complex64, dpnp.complex128] and array == [0, 3, 5]:
535535
pytest.skip(
536-
"per array API dpnp.power(complex(0,0)), 0) returns nan+nanj while NumPy returns 1+0j"
536+
"per array API dpnp.power(complex(0, 0)), 0) returns nan+nanj while NumPy returns 1+0j"
537537
)
538538
vander_func = lambda xp, x: xp.vander(x, N=n, increasing=increase)
539539

0 commit comments

Comments
 (0)