Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
00371ce
Update doc dependencies for furo migration
vlad-perevezentsev May 27, 2026
2a2b216
Switch Sphinx theme to furo in conf.py
vlad-perevezentsev May 27, 2026
3ff2adf
Redesign landing page with sphinx-design grid cards
vlad-perevezentsev May 27, 2026
7530aa9
Comment lines for future dpnp logo
vlad-perevezentsev May 28, 2026
1e5dfe6
Add custom CSS and JS for furo theme styling
vlad-perevezentsev May 28, 2026
4355506
Use html_title as interim sidebar branding for furo theme
vlad-perevezentsev May 28, 2026
b5464e3
Fix warnings in index.rst
vlad-perevezentsev May 28, 2026
bb95bb0
Merge remote-tracking branch 'origin/master' into update_dpnp_docs
vlad-perevezentsev May 28, 2026
b748d2e
Rename css/js custom files
vlad-perevezentsev May 28, 2026
bacc702
Add js file manually in setup()
vlad-perevezentsev May 28, 2026
48f18ff
Add debug step for check js file
vlad-perevezentsev May 29, 2026
bf5dcd1
Fix custom JS not executing
vlad-perevezentsev May 29, 2026
0f1f80c
Handle both EN DASH and double-hyphen separators in parameter reforma…
vlad-perevezentsev May 29, 2026
7bc144a
Remove Debug JS step
vlad-perevezentsev May 29, 2026
0bdc775
Merge master into update_dpnp_docs
vlad-perevezentsev Jun 11, 2026
01f4f01
Update _accumulation.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
ce0dbcf
Update _array_api.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
bb18a1c
Update _clip.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
71aa230
Update _copy_utils.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
550a7f9
Update _ctors.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
06da7e1
Update _data_types.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
9df90ee
Update _device.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
8c8cc73
Update _dlpack.pyx doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
fea6832
Update _flags.pyx doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
1d021b6
Update _elementwise_common.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
6f27c9c
Update _indexing_functions.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
f8db906
Update _elementwise_funcs.py doc to Sphinx format
vlad-perevezentsev Apr 7, 2026
4283245
Update _linear_algebra_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
e92de86
Update _manipulation_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
93f1421
Update _print.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
d44e198
Update _reduction.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
dec9739
Update _reshape.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
022c8d0
Update _search_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
6692c3a
Update _searchsorted.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
7517ded
Update _set_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
59373f7
Update _slicing.pxi doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
664e6c1
Update _sorting.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
39bf99c
Update _statistical_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
8eaed32
Update _testing.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
95f2a57
Update _type_util.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
ce277cd
Update _usmarray.pyx doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
bff1672
Update _utility_functions.py doc to Sphinx format
vlad-perevezentsev Apr 10, 2026
16cf161
Update _compute_follows_data.pyx. doc to Sphinx format
vlad-perevezentsev Jun 11, 2026
e98a6bf
Add missing None to parameter type
vlad-perevezentsev Jun 11, 2026
68ef2d4
Add missing Default values to parameter docstrings
vlad-perevezentsev Jun 11, 2026
4d5be4e
Add missing None to parameter type(2)
vlad-perevezentsev Jun 11, 2026
dc3a6c0
Fix typos in dpnp.tensor docs
vlad-perevezentsev Jun 11, 2026
7d11958
Fix wrong rST roles
vlad-perevezentsev Jun 11, 2026
b9726ae
Replace dpctl.tensor with dpnp.tensor
vlad-perevezentsev Jun 11, 2026
92e26db
Remove redundant signature lines
vlad-perevezentsev Jun 11, 2026
7233403
Fix parameter name mismatches
vlad-perevezentsev Jun 11, 2026
99a57f9
Small update _usmarray.pyx to Sphinx format
vlad-perevezentsev Jun 11, 2026
306bcca
Fix typos in dpnp.tensor docs(2)
vlad-perevezentsev Jun 11, 2026
124386e
Update usm_ndarray docstrings
vlad-perevezentsev Apr 10, 2026
4d67432
Add dpnp.tensor API reference documentation
vlad-perevezentsev Apr 10, 2026
318c890
Add user guides for dpnp.tensor module
vlad-perevezentsev Apr 10, 2026
8d48839
Fix some typos and gaps
vlad-perevezentsev Jun 11, 2026
183e6ba
Remove cross-reference fallback for dpnp.tensor to dpctl
vlad-perevezentsev Jun 11, 2026
d49a663
Add :nosignatures: for dpnp.tensor docs
vlad-perevezentsev Jun 11, 2026
0c475ac
Remove outdated dpctl.tensor docs link from tensor.rst
vlad-perevezentsev Jun 11, 2026
02c8775
Update usm_ndarray docs
vlad-perevezentsev Jun 11, 2026
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
91 changes: 91 additions & 0 deletions doc/_static/dpnp-custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/* Autosummary tables: left-aligned */
.longtable.docutils {
margin-left: 0;
margin-right: auto;
}

/* Admonitions: normal font size, no left accent bar */
div.admonition {
font-size: inherit !important;
border-left: 0 !important;
}

/* Table borders and alternating row backgrounds */
body table.docutils tbody tr.row-odd,
body table.docutils tbody tr.row-even {
background: transparent !important;
}

body table.docutils td,
body table.docutils th {
border: 1px solid var(--color-foreground-border) !important;
padding: 8px 12px;
}

body table.docutils thead th {
background-color: #e8edf2 !important;
}

body table.docutils tbody tr.row-odd {
background-color: #f5f5f5 !important;
}

/* Docstring section titles: normal case, bold, gray background */
dd p.rubric,
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .field-list > dt,
.admonition > .admonition-title {
text-transform: none !important;
font-size: inherit !important;
font-weight: 700 !important;
background-color: #f5f5f5;
padding: 4px 8px;
}

/* Constants page: lighter section headers */
#constants dd p.rubric {
background-color: transparent;
padding: 0;
border-bottom: 1px solid #ccc;
}

/* Function signatures: normal weight, bold only for name and param names */
dt.sig.sig-object,
dt.sig.sig-object * {
font-weight: 400 !important;
}

dt.sig.sig-object .sig-name,
dt.sig.sig-object .sig-name *,
dt.sig.sig-object .sig-param > .n,
dt.sig.sig-object .sig-param > .n * {
font-weight: 700 !important;
}

/* Parameter/return descriptions: indented on new line (via custom.js) */
dl.field-list dd .param-desc {
display: inline-block;
padding-left: 1.5em;
}

/* Parameter lists: no bullets, keep indentation */
dl.field-list dd ul.simple {
list-style: none !important;
padding-left: 1.2em !important;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
body table.docutils thead th {
background-color: #2a2e33 !important;
}
body table.docutils tbody tr.row-odd {
background-color: #1e2227 !important;
}
}

body[data-theme="dark"] table.docutils thead th {
background-color: #2a2e33 !important;
}
body[data-theme="dark"] table.docutils tbody tr.row-odd {
background-color: #1e2227 !important;
}
42 changes: 42 additions & 0 deletions doc/_static/dpnp-custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
(function() {
var separator = " – ";
var separatorAlt = " -- ";

function reformatEntry(container)
{
var paragraphs = container.querySelectorAll(":scope > p");
if (!paragraphs.length)
return;

var firstP = paragraphs[0];
var idx = firstP.innerHTML.indexOf(separator);
var sep = separator;
if (idx === -1) {
idx = firstP.innerHTML.indexOf(separatorAlt);
sep = separatorAlt;
}
if (idx === -1)
return;

var before = firstP.innerHTML.substring(0, idx);
var after = firstP.innerHTML.substring(idx + sep.length);

var extra = [];
for (var i = 1; i < paragraphs.length; i++) {
extra.push(paragraphs[i].innerHTML);
paragraphs[i].remove();
}
if (extra.length)
after += (after ? "<br>" : "") + extra.join("<br>");

firstP.innerHTML =
before + '<br><span class="param-desc">' + after + "</span>";
}

document.querySelectorAll("dl.field-list dd ul.simple li")
.forEach(reformatEntry);
document.querySelectorAll("dl.field-list dd").forEach(function(dd) {
if (!dd.querySelector("ul.simple"))
reformatEntry(dd);
});
})();
29 changes: 29 additions & 0 deletions doc/_templates/autosummary/cython_class.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ name }}
{% block methods %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:toctree: generated
{% for item in methods if item != "__init__" %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
:toctree: generated
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}
12 changes: 12 additions & 0 deletions doc/_templates/autosummary/elementwise.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}

{% if objtype == "data" %}
.. auto{{ objtype }}:: {{ objname }}
:no-value:
{% endif %}

{% if objtype == "function" %}
.. auto{{ objtype }}:: {{ objname }}
{% endif %}
48 changes: 48 additions & 0 deletions doc/_templates/autosummary/usm_ndarray.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{{ fullname | escape | underline}}

.. currentmodule:: {{ module }}



.. autoclass:: {{ name }}

{% block methods %}

{% if methods %}
.. rubric:: {{ _('Methods') }}

.. autosummary::
:toctree: generated
:nosignatures:
{% for item in methods if item != "__init__" %}
~{{ name }}.{{ item }}
{%- endfor %}
{% endif %}
{% endblock %}

{% block attributes %}
{% if attributes %}
.. rubric:: {{ _('Attributes') }}

.. autosummary::
:toctree: generated
:nosignatures:
{% for item in attributes %}
~{{ name }}.{{ item }}
{%- endfor %}

.. rubric:: {{ _('Special attributes') }}

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

~{{name}}.__dlpack_device__
~{{name}}.__dlpack__
~{{name}}.__sycl_usm_array_interface__
~{{name}}._pointer
~{{name}}._element_offset
~{{name}}._byte_bounds

{% endif %}
{% endblock %}
103 changes: 20 additions & 83 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# http://www.sphinx-doc.org/en/master/config

from datetime import datetime
from urllib.parse import urljoin

from sphinx.ext.autodoc import FunctionDocumenter
from sphinx.ext.napoleon import NumpyDocstring, docstring
Expand Down Expand Up @@ -68,10 +67,14 @@
"sphinx.ext.napoleon",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx_copybutton",
"sphinx_design",
"sphinxcontrib.googleanalytics",
"sphinxcontrib.spelling",
]

copybutton_prompt_text = ">>> "

googleanalytics_id = "G-554F8VNE28"
googleanalytics_enabled = True

Expand Down Expand Up @@ -106,20 +109,23 @@
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
pygments_style = "default"


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = 'alabaster'
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"sidebarwidth": 30,
"nosidebar": False,
}
html_theme = "furo"
# TODO: Remove html_title and uncomment html_logo once dpnp.svg is available
html_title = (
'<span style="font-size:2em;font-weight:700">dpnp</span><br>'
'<small style="font-size:0.75em">Data Parallel Extension for NumPy<br>'
+ release
+ " documentation</small>"
)
html_theme_options = {}

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -130,7 +136,12 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = []
html_static_path = ["_static"]

# html_logo = "_static/dpnp.svg"
# html_favicon = "_static/dpnp.svg"
html_css_files = ["dpnp-custom.css"]
html_js_files = ["dpnp-custom.js"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -140,15 +151,6 @@
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
# html_sidebars = {}
html_sidebars = {
"**": [
"globaltoc.html",
"relations.html",
"sourcelink.html",
"searchbox.html",
]
}


# -- Options for HTMLHelp output ---------------------------------------------
Expand Down Expand Up @@ -232,9 +234,6 @@ def _can_document_member(member, *args, **kwargs):

autosummary_generate = True

_DPCTL_021_BASE = "https://intelpython.github.io/dpctl/0.21.1/"
_DPCTL_021_INV = urljoin(_DPCTL_021_BASE, "objects.inv")

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
Expand Down Expand Up @@ -306,65 +305,3 @@ def _parse_returns_section_patched(self, section: str) -> list[str]:


NumpyDocstring._parse_returns_section = _parse_returns_section_patched


# TODO: Remove once dpnp.tensor docs are generated in dpnp
def _load_dpctl_tensor_inventory(app):
"""Load dpctl 0.21.1 inventory for dpnp.tensor fallback only."""
from sphinx.ext.intersphinx import fetch_inventory
from sphinx.util import logging

logger = logging.getLogger(__name__)

try:
inv = fetch_inventory(app, _DPCTL_021_BASE, _DPCTL_021_INV)
except Exception as exc:
logger.warning(
"Failed to load dpctl 0.21.1 inventory from %s: %s",
_DPCTL_021_INV,
exc,
)
inv = {}

app.builder.env._dpctl_tensor_021_inventory = inv


# TODO: Remove once dpnp.tensor docs are generated in dpnp
def _resolve_dpnp_tensor_refs(app, env, node, contnode):
"""Resolve dpnp.tensor.* references to dpctl 0.21.1 documentation.

This temporary workaround is needed because dpnp.tensor documentation
is not generated yet, while the corresponding API is still documented
in dpctl 0.21.1.
"""
from docutils import nodes as docutils_nodes

target = node.get("reftarget", "")
if not target.startswith("dpnp.tensor"):
return None

dpctl_target = target.replace("dpnp.tensor", "dpctl.tensor", 1)
dpctl_tensor_inv = getattr(env, "_dpctl_tensor_021_inventory", {})

for _objtype, objects in dpctl_tensor_inv.items():
if dpctl_target not in objects:
continue

item = objects[dpctl_target]
location = item.uri
if location.endswith("$"):
location = location[:-1] + dpctl_target

refuri = urljoin(_DPCTL_021_BASE, location)
newnode = docutils_nodes.reference(
"", "", internal=False, refuri=refuri
)
newnode += contnode.deepcopy()
return newnode

return None


def setup(app):
app.connect("builder-inited", _load_dpctl_tensor_inventory, priority=400)
app.connect("missing-reference", _resolve_dpnp_tensor_refs, priority=400)
Loading
Loading