Skip to content

Commit e3fd477

Browse files
Update API References and ndarray documentation (#1490)
* Update API Reference * Refresh Multi-Dimensional Array section * Pin to numpy<1.24 in build_sphinx (#1491) * Make subchapters for ndarray chapter * Rename Difference with NumPy chapter * Update Available array data types chapter * Delete structured data types line * Add missing docstrings * Hide empty subchapter of routines
1 parent 2a43630 commit e3fd477

19 files changed

+659
-50
lines changed

doc/reference/comparison.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Comparison Table
2-
================
1+
Comparison Table NumPy/ DPNP/ CuPy
2+
==================================
33

4-
Here is a list of NumPy APIs and its corresponding DPNP implementations.
4+
Here is a list of NumPy and CuPy APIs and its corresponding DPNP implementations.
55

66
``-`` in DPNP column means that DPNP implementation is not provided yet.
77

doc/reference/creation.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _routines.creation:
2+
13
Array Creation Routines
24
=======================
35

@@ -20,7 +22,6 @@ Basic creation routines
2022
dpnp.zeros_like
2123
dpnp.full
2224
dpnp.full_like
23-
dpnp.vander
2425

2526

2627
Creation from other data
@@ -35,7 +36,13 @@ Creation from other data
3536
dpnp.asanyarray
3637
dpnp.ascontiguousarray
3738
dpnp.copy
39+
dpnp.frombuffer
40+
dpnp.from_dlpack
3841
dpnp.fromfile
42+
dpnp.fromfunction
43+
dpnp.fromiter
44+
dpnp.fromstring
45+
dpnp.loadtxt
3946

4047

4148
Numerical ranges
@@ -66,3 +73,14 @@ Matrix creation
6673
dpnp.tri
6774
dpnp.tril
6875
dpnp.triu
76+
dpnp.vander
77+
78+
79+
The Matrix class
80+
----------------
81+
.. autosummary::
82+
:toctree: generated/
83+
:nosignatures:
84+
85+
dpnp.mat
86+
dpnp.bmat

doc/reference/difference.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

doc/reference/dtype.rst

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.. _dtype:
2+
3+
Data type routines
4+
==================
5+
6+
.. https://docs.scipy.org/doc/numpy/reference/routines.dtype.html
7+
8+
.. autosummary::
9+
:toctree: generated/
10+
:nosignatures:
11+
12+
dpnp.can_cast
13+
dpnp.promote_types
14+
dpnp.min_scalar_type
15+
dpnp.result_type
16+
dpnp.common_type
17+
dpnp.obj2sctype
18+
19+
Creating data types
20+
-------------------
21+
.. autosummary::
22+
:toctree: generated/
23+
:nosignatures:
24+
25+
dpnp.dtype
26+
dpnp.format_parser
27+
28+
Data type information
29+
---------------------
30+
.. autosummary::
31+
:toctree: generated/
32+
:nosignatures:
33+
34+
dpnp.finfo
35+
dpnp.iinfo
36+
37+
Data type testing
38+
-----------------
39+
.. autosummary::
40+
:toctree: generated/
41+
:nosignatures:
42+
43+
dpnp.issctype
44+
dpnp.issubdtype
45+
dpnp.issubsctype
46+
dpnp.issubclass_
47+
dpnp.find_common_type
48+
49+
Miscellaneous
50+
-------------
51+
.. autosummary::
52+
:toctree: generated/
53+
:nosignatures:
54+
55+
dpnp.typename
56+
dpnp.sctype2char
57+
dpnp.mintypecode
58+
dpnp.maximum_sctype

doc/reference/dtypes_table.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Available array data types
2+
==========================
3+
4+
.. _Data types:
5+
6+
7+
Table below shows a list of all supported data types (dtypes) and constants of the Data Parallel Extension for NumPy*.
8+
9+
.. list-table::
10+
:header-rows: 1
11+
12+
* - Data Types
13+
- Type aliases
14+
- Constants
15+
* -
16+
- :obj:`bool <numpy.bool_>`
17+
- :obj:`int32 <numpy.int32>`
18+
- :obj:`int64 <numpy.int64>`
19+
- :obj:`complex64 <numpy.complex64>`
20+
- :obj:`complex128 <numpy.complex128>`
21+
-
22+
- :obj:`bool_ <numpy.bool_>`
23+
- :obj:`cdouble <numpy.cdouble>`
24+
- :obj:`complex <numpy.complex_>`
25+
- :obj:`cfloat <numpy.cfloat>`
26+
- :obj:`csingle <numpy.csingle>`
27+
- :obj:`double <numpy.double>`
28+
- :obj:`float <numpy.float>`
29+
- :obj:`float_ <numpy.float_>`
30+
- :obj:`float16 <numpy.float16>`
31+
- :obj:`int <numpy.int>`
32+
- :obj:`int_ <numpy.int_>`
33+
- :obj:`intc <numpy.intc>`
34+
- :obj:`single <numpy.single>`
35+
- :obj:`singlecomplex <numpy.singlecomplex>`
36+
-
37+
- :obj:`e <numpy.e>`
38+
- :obj:`euler_gamma <numpy.euler_gamma>`
39+
- :obj:`Inf <numpy.Inf>`
40+
- :obj:`inf <numpy.inf>`
41+
- :obj:`Infinity <numpy.Infinity>`
42+
- :obj:`infty <numpy.infty>`
43+
- :obj:`NAN <numpy.NAN>`
44+
- :obj:`NaN <numpy.NaN>`
45+
- :obj:`nan <numpy.nan>`
46+
- :obj:`NINF <numpy.NINF>`
47+
- :obj:`NZERO <numpy.NZERO>`
48+
- :obj:`pi <numpy.pi>`
49+
- :obj:`PINF <numpy.PINF>`
50+
- :obj:`PZERO <numpy.PZERO>`

doc/reference/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ API reference of the Data Parallel Extension for NumPy*
3030
testing
3131
prof
3232
environment
33-
difference
33+
dtypes_table
3434
comparison
3535
misc

doc/reference/indexing.rst

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
.. _routines.indexing:
2+
3+
Array Indexing Routines
4+
=======================
5+
6+
.. https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html
7+
8+
Generating index arrays
9+
-----------------------
10+
11+
12+
.. autosummary::
13+
:toctree: generated/
14+
:nosignatures:
15+
16+
dpnp.c_
17+
dpnp.r_
18+
dpnp.s_
19+
dpnp.nonzero
20+
dpnp.where
21+
dpnp.indices
22+
dpnp.ix_
23+
dpnp.ogrid
24+
dpnp.ravel_multi_index
25+
dpnp.unravel_index
26+
dpnp.diag_indices
27+
dpnp.diag_indices_from
28+
dpnp.mask_indices
29+
dpnp.tril_indices
30+
dpnp.tril_indices_from
31+
dpnp.triu_indices
32+
dpnp.triu_indices_from
33+
34+
35+
Indexing-like operations
36+
------------------------
37+
.. autosummary::
38+
:toctree: generated/
39+
:nosignatures:
40+
41+
dpnp.take
42+
dpnp.take_along_axis
43+
dpnp.choose
44+
dpnp.compress
45+
dpnp.diag
46+
dpnp.diagonal
47+
dpnp.select
48+
49+
50+
Inserting data into arrays
51+
--------------------------
52+
.. autosummary::
53+
:toctree: generated/
54+
:nosignatures:
55+
56+
dpnp.place
57+
dpnp.put
58+
dpnp.put_along_axis
59+
dpnp.putmask
60+
dpnp.fill_diagonal
61+
62+
63+
Iterating over arrays
64+
---------------------
65+
.. autosummary::
66+
:toctree: generated/
67+
:nosignatures:
68+
69+
dpnp.nditer
70+
dpnp.ndenumerate
71+
dpnp.ndindex
72+
dpnp.nested_iters
73+
dpnp.flatiter
74+
dpnp.iterable

doc/reference/linalg.rst

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Matrix and vector products
1010
:toctree: generated/
1111
:nosignatures:
1212

13-
dpnp.cross
1413
dpnp.dot
1514
dpnp.linalg.multi_dot
1615
dpnp.vdot
@@ -46,15 +45,16 @@ Matrix eigenvalues
4645
dpnp.linalg.eigvals
4746
dpnp.linalg.eigvalsh
4847

49-
Norms etc.
48+
Norms and other numbers
5049
----------
5150

5251
.. autosummary::
5352
:toctree: generated/
5453
:nosignatures:
5554

56-
dpnp.linalg.det
5755
dpnp.linalg.norm
56+
dpnp.linalg.cond
57+
dpnp.linalg.det
5858
dpnp.linalg.matrix_rank
5959
dpnp.linalg.slogdet
6060
dpnp.trace
@@ -73,14 +73,3 @@ Solving linear equations
7373
dpnp.linalg.inv
7474
dpnp.linalg.pinv
7575
dpnp.linalg.tensorinv
76-
77-
Special Matrices
78-
----------------
79-
80-
.. autosummary::
81-
:toctree: generated/
82-
:nosignatures:
83-
84-
dpnp.tri
85-
dpnp.tril
86-
dpnp.triu

doc/reference/manipulation.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Basic operations
1111
:nosignatures:
1212

1313
dpnp.copyto
14+
dpnp.shape
1415

1516

1617
Changing array shape
@@ -22,6 +23,8 @@ Changing array shape
2223

2324
dpnp.reshape
2425
dpnp.ravel
26+
dpnp.ndarray.flat
27+
dpnp.ndarray.flatten
2528

2629

2730
Transpose-like operations
@@ -34,10 +37,9 @@ Transpose-like operations
3437
dpnp.moveaxis
3538
dpnp.rollaxis
3639
dpnp.swapaxes
40+
dpnp.ndarray.T
3741
dpnp.transpose
3842

39-
.. seealso::
40-
:attr:`dpnp.dparray.T`
4143

4244
Changing number of dimensions
4345
-----------------------------
@@ -66,6 +68,7 @@ Changing kind of array
6668
dpnp.asarray
6769
dpnp.asnumpy
6870
dpnp.asanyarray
71+
dpnp.asmatrix
6972
dpnp.asfarray
7073
dpnp.asfortranarray
7174
dpnp.ascontiguousarray
@@ -81,10 +84,12 @@ Joining arrays
8184

8285
dpnp.concatenate
8386
dpnp.stack
87+
dpnp.block
88+
dpnp.vstack
89+
dpnp.hstack
8490
dpnp.column_stack
91+
dpnp.row_stack
8592
dpnp.dstack
86-
dpnp.hstack
87-
dpnp.vstack
8893

8994

9095
Splitting arrays
@@ -119,6 +124,10 @@ Adding and removing elements
119124
:toctree: generated/
120125
:nosignatures:
121126

127+
dpnp.delete
128+
dpnp.insert
129+
dpnp.append
130+
dpnp.resize
122131
dpnp.unique
123132
dpnp.trim_zeros
124133

0 commit comments

Comments
 (0)