Skip to content

Update dpnp.ndarray docstrings #2422

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ extend-ignore =
D105,
# missing docstring in __init__:
D107,
# TODO: remove:
D200, D403,
# no blank lines allowed after function docstring:
D202,
# 1 blank line required between summary line and description:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ repos:
"--disable=redefined-builtin",
"--disable=unused-wildcard-import"
]
files: '^dpnp/(dpnp_iface.*|fft|linalg)'
files: '^dpnp/(dpnp_iface.*|fft|linalg|dpnp_array)'
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
Expand Down
27 changes: 24 additions & 3 deletions doc/reference/ndarray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ of the array:
dpnp.ndarray.size
dpnp.ndarray.itemsize
dpnp.ndarray.nbytes
dpnp.ndarray.base
dpnp.ndarray.device
dpnp.ndarray.sycl_context
dpnp.ndarray.sycl_device
dpnp.ndarray.sycl_queue
dpnp.ndarray.usm_type


Data type
Expand Down Expand Up @@ -98,6 +102,17 @@ Other attributes
dpnp.ndarray.flat


Special attributes
------------------

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

dpnp.ndarray.__sycl_usm_array_interface__
dpnp.ndarray.__usm_ndarray__


Array methods
-------------

Expand Down Expand Up @@ -145,6 +160,7 @@ Array conversion
dpnp.ndarray.getfield
dpnp.ndarray.setflags
dpnp.ndarray.fill
dpnp.ndarray.get_array


Shape manipulation
Expand Down Expand Up @@ -371,7 +387,10 @@ Basic customization:

dpnp.ndarray.__new__
dpnp.ndarray.__array__
dpnp.ndarray.__array_namespace__
dpnp.ndarray.__array_wrap__
dpnp.ndarray.__dlpack__
dpnp.ndarray.__dlpack_device__

Container customization: (see :ref:`Indexing <routines.indexing>`)

Expand All @@ -380,19 +399,21 @@ Container customization: (see :ref:`Indexing <routines.indexing>`)
:nosignatures:

dpnp.ndarray.__len__
dpnp.ndarray.__iter__
dpnp.ndarray.__getitem__
dpnp.ndarray.__setitem__
dpnp.ndarray.__contains__

Conversion; the operations :class:`int() <int>`,
:class:`float() <float>` and :class:`complex() <complex>`.
Conversion; the operations :class:`int() <int>`, :class:`float() <float>`,
:class:`complex() <complex>` and :func:`operator.index() <index>`.
They work only on arrays that have one element in them
and return the appropriate scalar.

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

dpnp.ndarray.__index__
dpnp.ndarray.__int__
dpnp.ndarray.__float__
dpnp.ndarray.__complex__
Expand Down
Loading
Loading