From 00371ceff8501dd62c9b756f26d6bbeb542103c3 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Wed, 27 May 2026 07:15:51 -0700 Subject: [PATCH 01/17] Update doc dependencies for furo migration --- environments/base_build_docs.txt | 2 ++ environments/building_docs.yml | 2 +- pyproject.toml | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/environments/base_build_docs.txt b/environments/base_build_docs.txt index edab09ee45ab..79e8cda1f45a 100644 --- a/environments/base_build_docs.txt +++ b/environments/base_build_docs.txt @@ -1,3 +1,5 @@ pyenchant==3.2.2 +sphinx-copybutton==0.5.2 +sphinx-design==0.6.1 sphinxcontrib-googleanalytics==0.4 sphinxcontrib-spelling==8.0.1 diff --git a/environments/building_docs.yml b/environments/building_docs.yml index 0857dd8431ba..07aeef7b68cd 100644 --- a/environments/building_docs.yml +++ b/environments/building_docs.yml @@ -5,6 +5,6 @@ dependencies: - python=3.13 # no dpctl package on PyPI with enabled python 3.14 support - cupy - sphinx - - sphinx_rtd_theme + - furo - pip: - -r base_build_docs.txt diff --git a/pyproject.toml b/pyproject.toml index 773d3cb45909..d7230c401599 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,8 +86,10 @@ coverage = [ docs = [ "Cython", "cupy", + "furo", "sphinx", - "sphinx_rtd_theme", + "sphinx-copybutton", + "sphinx-design", "pyenchant", "sphinxcontrib-googleanalytics", "sphinxcontrib-spelling" From 2a2b216150bfe7dca51961a046466e1a979feb4d Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Wed, 27 May 2026 07:19:02 -0700 Subject: [PATCH 02/17] Switch Sphinx theme to furo in conf.py --- doc/conf.py | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 57119eab5396..71ad62b67a98 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -68,10 +68,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 @@ -106,7 +110,7 @@ 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 ------------------------------------------------- @@ -114,12 +118,8 @@ # 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" +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 @@ -130,7 +130,10 @@ # 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" # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -140,15 +143,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 --------------------------------------------- From 3ff2adf36449ffecdd230ea850c64801b754943c Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Wed, 27 May 2026 07:20:58 -0700 Subject: [PATCH 03/17] Redesign landing page with sphinx-design grid cards --- doc/index.rst | 73 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 67 insertions(+), 6 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 847680fc11d9..0a8a053e1bf4 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,22 +1,83 @@ .. _index: .. include:: ./ext_links.txt +=================================== Data Parallel Extension for NumPy* -================================== +=================================== .. module:: dpnp :no-index: +Python package :py:mod:`dpnp` implements a subset of `NumPy*`_ that can be +executed on any data parallel device. The subset is a drop-in replacement of +core `NumPy*`_ functions and numerical data types. + +.. grid:: 2 + :gutter: 3 + + .. grid-item-card:: Overview + + Learn about the Data Parallel Extension for NumPy*, its design + principles, and what it provides. + + +++ + + .. button-ref:: overview + :expand: + :color: secondary + :click-parent: + + To the overview + + .. grid-item-card:: Quick Start Guide + + Get started with installation, setup, and your first dpnp program. + + +++ + + .. button-ref:: quick_start_guide + :expand: + :color: secondary + :click-parent: + + To the quick start guide + + .. grid-item-card:: API Reference + + Detailed documentation of all supported NumPy functions and classes + in :py:mod:`dpnp`. + + +++ + + .. button-ref:: dpnp_reference + :expand: + :color: secondary + :click-parent: + + Access API Reference + + .. grid-item-card:: Tensor (dpnp.tensor) + + The underlying Array API-compliant implementation based on + data-parallel algorithms for accelerators. + + +++ + + .. button-ref:: tensor + :expand: + :color: secondary + :click-parent: + + To the tensor documentation + + .. toctree:: :maxdepth: 2 + :hidden: + :caption: Contents: overview quick_start_guide reference/index tensor - -.. toctree:: - :maxdepth: 1 - :caption: Development information - dpnp_backend_api From 7530aa9716a18d38331336743353bc66ab9b9372 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 28 May 2026 04:47:57 -0700 Subject: [PATCH 04/17] Comment lines for future dpnp logo --- doc/conf.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 71ad62b67a98..7a1863a024da 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -132,8 +132,10 @@ # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] -html_logo = "_static/dpnp.svg" -html_favicon = "_static/dpnp.svg" +# html_logo = "_static/dpnp.svg" +# html_favicon = "_static/dpnp.svg" +html_css_files = ["custom.css"] +html_js_files = ["custom.js"] # Custom sidebar templates, must be a dictionary that maps document names # to template names. From 1e5dfe6a8d99fd98488ef81dbcebc7023380c8c9 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 28 May 2026 04:50:07 -0700 Subject: [PATCH 05/17] Add custom CSS and JS for furo theme styling --- doc/_static/custom.css | 91 ++++++++++++++++++++++++++++++++++++++++++ doc/_static/custom.js | 36 +++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 doc/_static/custom.css create mode 100644 doc/_static/custom.js diff --git a/doc/_static/custom.css b/doc/_static/custom.css new file mode 100644 index 000000000000..b39972f6df3e --- /dev/null +++ b/doc/_static/custom.css @@ -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; +} diff --git a/doc/_static/custom.js b/doc/_static/custom.js new file mode 100644 index 000000000000..63b2200a4698 --- /dev/null +++ b/doc/_static/custom.js @@ -0,0 +1,36 @@ +document.addEventListener("DOMContentLoaded", function() { + var separator = " – "; + + function reformatEntry(container) + { + var paragraphs = container.querySelectorAll(":scope > p"); + if (!paragraphs.length) + return; + + var firstP = paragraphs[0]; + var idx = firstP.innerHTML.indexOf(separator); + if (idx === -1) + return; + + var before = firstP.innerHTML.substring(0, idx); + var after = firstP.innerHTML.substring(idx + separator.length); + + var extra = []; + for (var i = 1; i < paragraphs.length; i++) { + extra.push(paragraphs[i].innerHTML); + paragraphs[i].remove(); + } + if (extra.length) + after += (after ? "
" : "") + extra.join("
"); + + firstP.innerHTML = + before + '
' + after + ""; + } + + 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); + }); +}); From 4355506e367dacc83a093a3899636bed4a491eb3 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 28 May 2026 05:16:37 -0700 Subject: [PATCH 06/17] Use html_title as interim sidebar branding for furo theme --- doc/conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/conf.py b/doc/conf.py index 7a1863a024da..69b193fcd9d6 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -119,6 +119,13 @@ # a list of builtin themes. # html_theme = "furo" +# TODO: Remove html_title and uncomment html_logo once dpnp.svg is available +html_title = ( + 'dpnp
' + 'Data Parallel Extension for NumPy
' + + release + + " documentation
" +) html_theme_options = {} # Theme options are theme-specific and customize the look and feel of a theme From b5464e3309782ca4d47a630e71c234175a1837eb Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 28 May 2026 05:32:34 -0700 Subject: [PATCH 07/17] Fix warnings in index.rst --- doc/index.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/index.rst b/doc/index.rst index 0a8a053e1bf4..20d0f3ee14d9 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -23,6 +23,7 @@ core `NumPy*`_ functions and numerical data types. +++ .. button-ref:: overview + :ref-type: doc :expand: :color: secondary :click-parent: @@ -36,6 +37,7 @@ core `NumPy*`_ functions and numerical data types. +++ .. button-ref:: quick_start_guide + :ref-type: doc :expand: :color: secondary :click-parent: @@ -50,6 +52,7 @@ core `NumPy*`_ functions and numerical data types. +++ .. button-ref:: dpnp_reference + :ref-type: ref :expand: :color: secondary :click-parent: @@ -64,6 +67,7 @@ core `NumPy*`_ functions and numerical data types. +++ .. button-ref:: tensor + :ref-type: doc :expand: :color: secondary :click-parent: From b748d2ed0e1ad0d1602c593726f92fb899a714cd Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 28 May 2026 12:23:12 -0700 Subject: [PATCH 08/17] Rename css/js custom files --- doc/_static/{custom.css => dpnp-css-custom.css} | 0 doc/_static/{custom.js => dpnp-js-custom.js} | 0 doc/conf.py | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename doc/_static/{custom.css => dpnp-css-custom.css} (100%) rename doc/_static/{custom.js => dpnp-js-custom.js} (100%) diff --git a/doc/_static/custom.css b/doc/_static/dpnp-css-custom.css similarity index 100% rename from doc/_static/custom.css rename to doc/_static/dpnp-css-custom.css diff --git a/doc/_static/custom.js b/doc/_static/dpnp-js-custom.js similarity index 100% rename from doc/_static/custom.js rename to doc/_static/dpnp-js-custom.js diff --git a/doc/conf.py b/doc/conf.py index 69b193fcd9d6..315cb5849756 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -141,8 +141,8 @@ # html_logo = "_static/dpnp.svg" # html_favicon = "_static/dpnp.svg" -html_css_files = ["custom.css"] -html_js_files = ["custom.js"] +html_css_files = ["dpnp-css-custom.css"] +html_js_files = ["dpnp-js-custom.js"] # Custom sidebar templates, must be a dictionary that maps document names # to template names. From bacc7025e43d37829df619be2d4d7207ff75d2fd Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 28 May 2026 13:47:42 -0700 Subject: [PATCH 09/17] Add js file manually in setup() --- doc/_static/{dpnp-css-custom.css => dpnp-custom.css} | 0 doc/_static/{dpnp-js-custom.js => dpnp-custom.js} | 0 doc/conf.py | 4 ++-- 3 files changed, 2 insertions(+), 2 deletions(-) rename doc/_static/{dpnp-css-custom.css => dpnp-custom.css} (100%) rename doc/_static/{dpnp-js-custom.js => dpnp-custom.js} (100%) diff --git a/doc/_static/dpnp-css-custom.css b/doc/_static/dpnp-custom.css similarity index 100% rename from doc/_static/dpnp-css-custom.css rename to doc/_static/dpnp-custom.css diff --git a/doc/_static/dpnp-js-custom.js b/doc/_static/dpnp-custom.js similarity index 100% rename from doc/_static/dpnp-js-custom.js rename to doc/_static/dpnp-custom.js diff --git a/doc/conf.py b/doc/conf.py index 315cb5849756..cdd115c55ee5 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -141,8 +141,7 @@ # html_logo = "_static/dpnp.svg" # html_favicon = "_static/dpnp.svg" -html_css_files = ["dpnp-css-custom.css"] -html_js_files = ["dpnp-js-custom.js"] +html_css_files = ["dpnp-custom.css"] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -369,5 +368,6 @@ def _resolve_dpnp_tensor_refs(app, env, node, contnode): def setup(app): + app.add_js_file("dpnp-custom.js") app.connect("builder-inited", _load_dpctl_tensor_inventory, priority=400) app.connect("missing-reference", _resolve_dpnp_tensor_refs, priority=400) From 48f18ff556c41620ab647c367d8176cdbb6b8174 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Fri, 29 May 2026 03:42:16 -0700 Subject: [PATCH 10/17] Add debug step for check js file --- .github/workflows/build-sphinx.yml | 43 ++++++++++++++++++++++++++++++ doc/conf.py | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index 07a228c82431..4c17a53b6132 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -167,6 +167,49 @@ jobs: make html working-directory: doc + - name: Debug JS inclusion + run: | + echo "=== Sphinx and Furo versions ===" + python -c "import sphinx; print('Sphinx:', sphinx.__version__)" + python -c "import furo; print('Furo:', furo.__version__)" + + echo "=== Check if JS file exists in build output ===" + ls -la doc/_build/html/_static/dpnp-custom.* 2>&1 || echo "FILES NOT FOUND" + + echo "=== Check conf.py html_js_files setting ===" + grep -n "html_js_files\|add_js_file" doc/conf.py + + echo "=== Search for dpnp-custom in any HTML file ===" + grep -rl "dpnp-custom" doc/_build/html/ | head -10 || echo "NO REFERENCES FOUND" + + echo "=== Check index.html head section ===" + head -50 doc/_build/html/index.html + + echo "=== Check index.html tail (scripts at body end) ===" + tail -30 doc/_build/html/index.html + + echo "=== Check a generated function page for script tags ===" + grep -i "/dev/null | head -10 || echo "NOT FOUND" + + echo "=== List all files in _static that match custom ===" + find doc/_build/html/_static/ -name "*custom*" -o -name "*dpnp*" 2>/dev/null + - name: Set a project number to current release run: | PROJECT_NUMBER=$(git describe --tags --abbrev=0) diff --git a/doc/conf.py b/doc/conf.py index cdd115c55ee5..45fcf45852c0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -142,6 +142,7 @@ # html_logo = "_static/dpnp.svg" # html_favicon = "_static/dpnp.svg" html_css_files = ["dpnp-custom.css"] +html_js_files = [("dpnp-custom.js", {"defer": ""})] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -368,6 +369,5 @@ def _resolve_dpnp_tensor_refs(app, env, node, contnode): def setup(app): - app.add_js_file("dpnp-custom.js") app.connect("builder-inited", _load_dpctl_tensor_inventory, priority=400) app.connect("missing-reference", _resolve_dpnp_tensor_refs, priority=400) From bf5dcd13c36ff477c8a1ddbbca2b3de7bd1a186e Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Fri, 29 May 2026 06:43:05 -0700 Subject: [PATCH 11/17] Fix custom JS not executing --- doc/_static/dpnp-custom.js | 58 +++++++++++++++++++------------------- doc/conf.py | 2 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/doc/_static/dpnp-custom.js b/doc/_static/dpnp-custom.js index 63b2200a4698..c29bfa9752af 100644 --- a/doc/_static/dpnp-custom.js +++ b/doc/_static/dpnp-custom.js @@ -1,36 +1,36 @@ -document.addEventListener("DOMContentLoaded", function() { - var separator = " – "; +(function() { +var separator = " – "; - function reformatEntry(container) - { - var paragraphs = container.querySelectorAll(":scope > p"); - if (!paragraphs.length) - return; +function reformatEntry(container) +{ + var paragraphs = container.querySelectorAll(":scope > p"); + if (!paragraphs.length) + return; - var firstP = paragraphs[0]; - var idx = firstP.innerHTML.indexOf(separator); - if (idx === -1) - return; + var firstP = paragraphs[0]; + var idx = firstP.innerHTML.indexOf(separator); + if (idx === -1) + return; - var before = firstP.innerHTML.substring(0, idx); - var after = firstP.innerHTML.substring(idx + separator.length); + var before = firstP.innerHTML.substring(0, idx); + var after = firstP.innerHTML.substring(idx + separator.length); - var extra = []; - for (var i = 1; i < paragraphs.length; i++) { - extra.push(paragraphs[i].innerHTML); - paragraphs[i].remove(); - } - if (extra.length) - after += (after ? "
" : "") + extra.join("
"); - - firstP.innerHTML = - before + '
' + after + ""; + var extra = []; + for (var i = 1; i < paragraphs.length; i++) { + extra.push(paragraphs[i].innerHTML); + paragraphs[i].remove(); } + if (extra.length) + after += (after ? "
" : "") + extra.join("
"); + + firstP.innerHTML = + before + '
' + after + ""; +} - 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); - }); +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); }); +})(); diff --git a/doc/conf.py b/doc/conf.py index 45fcf45852c0..107edb8956c1 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -142,7 +142,7 @@ # html_logo = "_static/dpnp.svg" # html_favicon = "_static/dpnp.svg" html_css_files = ["dpnp-custom.css"] -html_js_files = [("dpnp-custom.js", {"defer": ""})] +html_js_files = ["dpnp-custom.js"] # Custom sidebar templates, must be a dictionary that maps document names # to template names. From 0f1f80c72cf926c69dc03bf9b5a1106560ce1822 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Fri, 29 May 2026 08:04:52 -0700 Subject: [PATCH 12/17] Handle both EN DASH and double-hyphen separators in parameter reformatter --- doc/_static/dpnp-custom.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/_static/dpnp-custom.js b/doc/_static/dpnp-custom.js index c29bfa9752af..cce448d9c17b 100644 --- a/doc/_static/dpnp-custom.js +++ b/doc/_static/dpnp-custom.js @@ -1,5 +1,6 @@ (function() { var separator = " – "; +var separatorAlt = " -- "; function reformatEntry(container) { @@ -9,11 +10,16 @@ function reformatEntry(container) 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 + separator.length); + var after = firstP.innerHTML.substring(idx + sep.length); var extra = []; for (var i = 1; i < paragraphs.length; i++) { From 7bc144a5fe95cca5dfdceef2f4c1eda437061dd3 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Fri, 29 May 2026 08:05:49 -0700 Subject: [PATCH 13/17] Remove Debug JS step --- .github/workflows/build-sphinx.yml | 43 ------------------------------ 1 file changed, 43 deletions(-) diff --git a/.github/workflows/build-sphinx.yml b/.github/workflows/build-sphinx.yml index 4c17a53b6132..07a228c82431 100644 --- a/.github/workflows/build-sphinx.yml +++ b/.github/workflows/build-sphinx.yml @@ -167,49 +167,6 @@ jobs: make html working-directory: doc - - name: Debug JS inclusion - run: | - echo "=== Sphinx and Furo versions ===" - python -c "import sphinx; print('Sphinx:', sphinx.__version__)" - python -c "import furo; print('Furo:', furo.__version__)" - - echo "=== Check if JS file exists in build output ===" - ls -la doc/_build/html/_static/dpnp-custom.* 2>&1 || echo "FILES NOT FOUND" - - echo "=== Check conf.py html_js_files setting ===" - grep -n "html_js_files\|add_js_file" doc/conf.py - - echo "=== Search for dpnp-custom in any HTML file ===" - grep -rl "dpnp-custom" doc/_build/html/ | head -10 || echo "NO REFERENCES FOUND" - - echo "=== Check index.html head section ===" - head -50 doc/_build/html/index.html - - echo "=== Check index.html tail (scripts at body end) ===" - tail -30 doc/_build/html/index.html - - echo "=== Check a generated function page for script tags ===" - grep -i "/dev/null | head -10 || echo "NOT FOUND" - - echo "=== List all files in _static that match custom ===" - find doc/_build/html/_static/ -name "*custom*" -o -name "*dpnp*" 2>/dev/null - - name: Set a project number to current release run: | PROJECT_NUMBER=$(git describe --tags --abbrev=0) From ac4b3900b1124d7697502ba7a0f6e3d96c5d765f Mon Sep 17 00:00:00 2001 From: vlad-perevezentsev Date: Wed, 24 Jun 2026 07:47:36 -0700 Subject: [PATCH 14/17] Apply remarks --- doc/conf.py | 12 +++--------- doc/ext_links.txt | 1 + doc/index.rst | 27 ++++++++++++++++++++++++--- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 107edb8956c1..91a2e9a2d419 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -45,9 +45,8 @@ copyright = f"2020-{year}, Intel Corporation" author = "Intel" -version = dpnp.__version__.strip(".dirty") -# The full version, including alpha/beta/rc tags -release = dpnp.__version__.strip(".dirty") +# Strip local version identifiers (e.g. git hash) from the version string +version = release = dpnp.__version__.split("+")[0] # -- General configuration --------------------------------------------------- @@ -120,12 +119,7 @@ # html_theme = "furo" # TODO: Remove html_title and uncomment html_logo once dpnp.svg is available -html_title = ( - 'dpnp
' - 'Data Parallel Extension for NumPy
' - + release - + " documentation
" -) +html_title = f"Data Parallel Extension for NumPy (dpnp) {release} documentation" html_theme_options = {} # Theme options are theme-specific and customize the look and feel of a theme diff --git a/doc/ext_links.txt b/doc/ext_links.txt index d7a858723fc6..f88c7f4c4069 100644 --- a/doc/ext_links.txt +++ b/doc/ext_links.txt @@ -4,6 +4,7 @@ ********************************************************** .. _NumPy*: https://numpy.org/ +.. _SciPy*: https://scipy.org/ .. _Python* Array API Standard: https://data-apis.org/array-api/ .. _OpenCl*: https://www.khronos.org/opencl/ .. _oneAPI Level Zero: https://spec.oneapi.io/level-zero/latest/index.html diff --git a/doc/index.rst b/doc/index.rst index 20d0f3ee14d9..4a21460162b1 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -8,9 +8,10 @@ Data Parallel Extension for NumPy* .. module:: dpnp :no-index: -Python package :py:mod:`dpnp` implements a subset of `NumPy*`_ that can be -executed on any data parallel device. The subset is a drop-in replacement of -core `NumPy*`_ functions and numerical data types. +:py:mod:`dpnp` is a NumPy-compatible array library for data-parallel +computing. It acts as a drop-in replacement for core `NumPy*`_ functions +and numerical data types and provides implementations of selected +`SciPy*`_ routines for data-parallel devices. .. grid:: 2 :gutter: 3 @@ -74,6 +75,20 @@ core `NumPy*`_ functions and numerical data types. To the tensor documentation + .. grid-item-card:: Development information + + C++ backend API reference and extension documentation for developers. + + +++ + + .. button-ref:: dpnp_backend_api + :ref-type: doc + :expand: + :color: secondary + :click-parent: + + To the backend API reference + .. toctree:: :maxdepth: 2 @@ -84,4 +99,10 @@ core `NumPy*`_ functions and numerical data types. quick_start_guide reference/index tensor + +.. toctree:: + :maxdepth: 1 + :hidden: + :caption: Development information + dpnp_backend_api From 3d3ae8fc602e147f2ef92050f5063ef40d927c84 Mon Sep 17 00:00:00 2001 From: vlad-perevezentsev Date: Wed, 24 Jun 2026 07:57:22 -0700 Subject: [PATCH 15/17] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a2dc01b8987..d34a10844bc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ This release is compatible with NumPy 2.5. * Allowed `dpnp.take` and `dpnp.compress` to cast the result into an `out` array of a different but same-kind dtype [#2959](https://github.com/IntelPython/dpnp/pull/2959) * Clarified the summary in `dpnp.reshape` and `dpnp.ndarray.reshape` docstrings [#2964](https://github.com/IntelPython/dpnp/pull/2964) * Changed `dpnp.atleast_1d`, `dpnp.atleast_2d`, `dpnp.atleast_3d`, and `dpnp.ogrid` to return a tuple of arrays instead of a list [#2965](https://github.com/IntelPython/dpnp/pull/2965) +* Refreshed `dpnp` documentation styling with the Furo theme [#2934](https://github.com/IntelPython/dpnp/pull/2934) ### Deprecated From d39cd2a042ef0bbd5c4ff6ae4bbc39407d3bfd07 Mon Sep 17 00:00:00 2001 From: vlad-perevezentsev Date: Thu, 25 Jun 2026 11:26:22 -0700 Subject: [PATCH 16/17] Apply remarks --- doc/_static/dpnp-custom.css | 31 ++++----------- doc/_static/dpnp-custom.js | 75 ++++++++++++++++++++++++------------- doc/conf.py | 9 +---- 3 files changed, 59 insertions(+), 56 deletions(-) diff --git a/doc/_static/dpnp-custom.css b/doc/_static/dpnp-custom.css index b39972f6df3e..ccbc71bd6cf9 100644 --- a/doc/_static/dpnp-custom.css +++ b/doc/_static/dpnp-custom.css @@ -23,21 +23,21 @@ body table.docutils th { } body table.docutils thead th { - background-color: #e8edf2 !important; + background-color: var(--color-background-secondary) !important; } body table.docutils tbody tr.row-odd { - background-color: #f5f5f5 !important; + background-color: var(--color-background-secondary) !important; } -/* Docstring section titles: normal case, bold, gray background */ +/* Docstring section titles: normal case, bold, secondary 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; + background-color: var(--color-background-secondary); padding: 4px 8px; } @@ -45,7 +45,7 @@ dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(. #constants dd p.rubric { background-color: transparent; padding: 0; - border-bottom: 1px solid #ccc; + border-bottom: 1px solid var(--color-foreground-border); } /* Function signatures: normal weight, bold only for name and param names */ @@ -61,9 +61,9 @@ dt.sig.sig-object .sig-param > .n * { font-weight: 700 !important; } -/* Parameter/return descriptions: indented on new line (via custom.js) */ +/* Parameter/return descriptions: indented block on new line (via custom.js) */ dl.field-list dd .param-desc { - display: inline-block; + display: block; padding-left: 1.5em; } @@ -72,20 +72,3 @@ 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; -} diff --git a/doc/_static/dpnp-custom.js b/doc/_static/dpnp-custom.js index cce448d9c17b..b40ef0365036 100644 --- a/doc/_static/dpnp-custom.js +++ b/doc/_static/dpnp-custom.js @@ -1,36 +1,61 @@ (function() { -var separator = " – "; -var separatorAlt = " -- "; +var separators = [ " – ", " -- " ]; +function findSeparator(container) +{ + var walker = document.createTreeWalker(container, NodeFilter.SHOW_TEXT); + var node; + while ((node = walker.nextNode())) { + for (var i = 0; i < separators.length; i++) { + var idx = node.nodeValue.indexOf(separators[i]); + if (idx !== -1) + return {node : node, offset : idx, sep : separators[i]}; + } + } + return null; +} + +// Splits

at the separator; wraps everything after it in .param-desc. +function reformatP(p) +{ + var found = findSeparator(p); + if (!found) + return null; + + var afterNode = found.node.splitText(found.offset); + afterNode.nodeValue = afterNode.nodeValue.slice(found.sep.length); + + var range = document.createRange(); + range.setStartBefore(afterNode); + range.setEndAfter(p.lastChild); + + var desc = document.createElement("span"); + desc.className = "param-desc"; + desc.appendChild(range.extractContents()); + p.appendChild(desc); + return desc; +} + +// Browsers auto-close nested

tags, so multi-paragraph descriptions +// arrive as sibling

elements inside

  • . Fold them into the same desc. function reformatEntry(container) { - var paragraphs = container.querySelectorAll(":scope > p"); - if (!paragraphs.length) + var firstP = container.querySelector(":scope > p"); + if (!firstP) 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) + var desc = reformatP(firstP); + if (!desc) 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(); + var sibling; + while ((sibling = firstP.nextElementSibling) && sibling.tagName === "P") { + if (desc.textContent.trim()) + desc.appendChild(document.createElement("br")); + while (sibling.firstChild) + desc.appendChild(sibling.firstChild); + sibling.remove(); } - if (extra.length) - after += (after ? "
    " : "") + extra.join("
    "); - - firstP.innerHTML = - before + '
    ' + after + ""; } document.querySelectorAll("dl.field-list dd ul.simple li") @@ -39,4 +64,4 @@ document.querySelectorAll("dl.field-list dd").forEach(function(dd) { if (!dd.querySelector("ul.simple")) reformatEntry(dd); }); -})(); +}()); diff --git a/doc/conf.py b/doc/conf.py index 91a2e9a2d419..0c31bc413caa 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -73,7 +73,8 @@ "sphinxcontrib.spelling", ] -copybutton_prompt_text = ">>> " +copybutton_prompt_text = r">>> |\.\.\. " +copybutton_prompt_is_regexp = True googleanalytics_id = "G-554F8VNE28" googleanalytics_enabled = True @@ -122,12 +123,6 @@ html_title = f"Data Parallel Extension for NumPy (dpnp) {release} documentation" 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 -# documentation. -# -# html_theme_options = {} - # 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". From c4ccfda50b5389fb6d9372e74117130841454f48 Mon Sep 17 00:00:00 2001 From: vlad-perevezentsev Date: Thu, 25 Jun 2026 11:37:47 -0700 Subject: [PATCH 17/17] A small update .css file --- doc/_static/dpnp-custom.css | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/doc/_static/dpnp-custom.css b/doc/_static/dpnp-custom.css index ccbc71bd6cf9..6c4495a213ba 100644 --- a/doc/_static/dpnp-custom.css +++ b/doc/_static/dpnp-custom.css @@ -11,23 +11,19 @@ div.admonition { } /* 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 { +body table.docutils thead th, +body table.docutils tbody tr.row-odd { background-color: var(--color-background-secondary) !important; } -body table.docutils tbody tr.row-odd { - background-color: var(--color-background-secondary) !important; +body table.docutils tbody tr.row-even { + background: transparent !important; } /* Docstring section titles: normal case, bold, secondary background */