Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API References and ndarray documentation #1490

Merged
merged 12 commits into from
Aug 18, 2023
6 changes: 3 additions & 3 deletions doc/reference/comparison.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Comparison Table
================
Comparison Table NumPy/ DPNP/ CuPy
==================================

Here is a list of NumPy APIs and its corresponding DPNP implementations.
Here is a list of NumPy and CuPy APIs and its corresponding DPNP implementations.

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

Expand Down
20 changes: 19 additions & 1 deletion doc/reference/creation.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _routines.creation:

Array Creation Routines
=======================

Expand All @@ -20,7 +22,6 @@ Basic creation routines
dpnp.zeros_like
dpnp.full
dpnp.full_like
dpnp.vander


Creation from other data
Expand All @@ -35,7 +36,13 @@ Creation from other data
dpnp.asanyarray
dpnp.ascontiguousarray
dpnp.copy
dpnp.frombuffer
dpnp.from_dlpack
dpnp.fromfile
dpnp.fromfunction
dpnp.fromiter
dpnp.fromstring
dpnp.loadtxt


Numerical ranges
Expand Down Expand Up @@ -66,3 +73,14 @@ Matrix creation
dpnp.tri
dpnp.tril
dpnp.triu
dpnp.vander


The Matrix class
----------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.mat
dpnp.bmat
10 changes: 0 additions & 10 deletions doc/reference/difference.rst

This file was deleted.

58 changes: 58 additions & 0 deletions doc/reference/dtype.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
.. _dtype:

Data type routines
==================

.. https://docs.scipy.org/doc/numpy/reference/routines.dtype.html

.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.can_cast
dpnp.promote_types
dpnp.min_scalar_type
dpnp.result_type
dpnp.common_type
dpnp.obj2sctype

Creating data types
-------------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.dtype
dpnp.format_parser

Data type information
---------------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.finfo
dpnp.iinfo

Data type testing
-----------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.issctype
dpnp.issubdtype
dpnp.issubsctype
dpnp.issubclass_
dpnp.find_common_type

Miscellaneous
-------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.typename
dpnp.sctype2char
dpnp.mintypecode
dpnp.maximum_sctype
50 changes: 50 additions & 0 deletions doc/reference/dtypes_table.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Available array data types
==========================

.. _Data types:


Table below shows a list of all supported data types (dtypes) and constants of the Data Parallel Extension for NumPy*.

.. list-table::
:header-rows: 1

* - Data Types
- Type aliases
- Constants
* -
- :obj:`bool <numpy.bool_>`
- :obj:`int32 <numpy.int32>`
- :obj:`int64 <numpy.int64>`
- :obj:`complex64 <numpy.complex64>`
- :obj:`complex128 <numpy.complex128>`
-
- :obj:`bool_ <numpy.bool_>`
- :obj:`cdouble <numpy.cdouble>`
- :obj:`complex <numpy.complex_>`
- :obj:`cfloat <numpy.cfloat>`
- :obj:`csingle <numpy.csingle>`
- :obj:`double <numpy.double>`
- :obj:`float <numpy.float>`
- :obj:`float_ <numpy.float_>`
- :obj:`float16 <numpy.float16>`
- :obj:`int <numpy.int>`
- :obj:`int_ <numpy.int_>`
- :obj:`intc <numpy.intc>`
- :obj:`single <numpy.single>`
- :obj:`singlecomplex <numpy.singlecomplex>`
-
- :obj:`e <numpy.e>`
- :obj:`euler_gamma <numpy.euler_gamma>`
- :obj:`Inf <numpy.Inf>`
- :obj:`inf <numpy.inf>`
- :obj:`Infinity <numpy.Infinity>`
- :obj:`infty <numpy.infty>`
- :obj:`NAN <numpy.NAN>`
- :obj:`NaN <numpy.NaN>`
- :obj:`nan <numpy.nan>`
- :obj:`NINF <numpy.NINF>`
- :obj:`NZERO <numpy.NZERO>`
- :obj:`pi <numpy.pi>`
- :obj:`PINF <numpy.PINF>`
- :obj:`PZERO <numpy.PZERO>`
2 changes: 1 addition & 1 deletion doc/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ API reference of the Data Parallel Extension for NumPy*
testing
prof
environment
difference
dtypes_table
comparison
misc
74 changes: 74 additions & 0 deletions doc/reference/indexing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
.. _routines.indexing:

Array Indexing Routines
=======================

.. https://docs.scipy.org/doc/numpy/reference/arrays.indexing.html

Generating index arrays
-----------------------


.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.c_
dpnp.r_
dpnp.s_
dpnp.nonzero
dpnp.where
dpnp.indices
dpnp.ix_
dpnp.ogrid
dpnp.ravel_multi_index
dpnp.unravel_index
dpnp.diag_indices
dpnp.diag_indices_from
dpnp.mask_indices
dpnp.tril_indices
dpnp.tril_indices_from
dpnp.triu_indices
dpnp.triu_indices_from


Indexing-like operations
------------------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.take
dpnp.take_along_axis
dpnp.choose
dpnp.compress
dpnp.diag
dpnp.diagonal
dpnp.select


Inserting data into arrays
--------------------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.place
dpnp.put
dpnp.put_along_axis
dpnp.putmask
dpnp.fill_diagonal


Iterating over arrays
---------------------
.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.nditer
dpnp.ndenumerate
dpnp.ndindex
dpnp.nested_iters
dpnp.flatiter
dpnp.iterable
17 changes: 3 additions & 14 deletions doc/reference/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Matrix and vector products
:toctree: generated/
:nosignatures:

dpnp.cross
dpnp.dot
dpnp.linalg.multi_dot
dpnp.vdot
Expand Down Expand Up @@ -46,15 +45,16 @@ Matrix eigenvalues
dpnp.linalg.eigvals
dpnp.linalg.eigvalsh

Norms etc.
Norms and other numbers
----------

.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.linalg.det
dpnp.linalg.norm
dpnp.linalg.cond
dpnp.linalg.det
dpnp.linalg.matrix_rank
dpnp.linalg.slogdet
dpnp.trace
Expand All @@ -73,14 +73,3 @@ Solving linear equations
dpnp.linalg.inv
dpnp.linalg.pinv
dpnp.linalg.tensorinv

Special Matrices
----------------

.. autosummary::
:toctree: generated/
:nosignatures:

dpnp.tri
dpnp.tril
dpnp.triu
17 changes: 13 additions & 4 deletions doc/reference/manipulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Basic operations
:nosignatures:

dpnp.copyto
dpnp.shape


Changing array shape
Expand All @@ -22,6 +23,8 @@ Changing array shape

dpnp.reshape
dpnp.ravel
dpnp.ndarray.flat
dpnp.ndarray.flatten


Transpose-like operations
Expand All @@ -34,10 +37,9 @@ Transpose-like operations
dpnp.moveaxis
dpnp.rollaxis
dpnp.swapaxes
dpnp.ndarray.T
dpnp.transpose

.. seealso::
:attr:`dpnp.dparray.T`

Changing number of dimensions
-----------------------------
Expand Down Expand Up @@ -66,6 +68,7 @@ Changing kind of array
dpnp.asarray
dpnp.asnumpy
dpnp.asanyarray
dpnp.asmatrix
dpnp.asfarray
dpnp.asfortranarray
dpnp.ascontiguousarray
Expand All @@ -81,10 +84,12 @@ Joining arrays

dpnp.concatenate
dpnp.stack
dpnp.block
dpnp.vstack
dpnp.hstack
dpnp.column_stack
dpnp.row_stack
dpnp.dstack
dpnp.hstack
dpnp.vstack


Splitting arrays
Expand Down Expand Up @@ -119,6 +124,10 @@ Adding and removing elements
:toctree: generated/
:nosignatures:

dpnp.delete
dpnp.insert
dpnp.append
dpnp.resize
dpnp.unique
dpnp.trim_zeros

Expand Down
Loading
Loading