Skip to content

Fix documentation rendering for dpnp.ndarray operator methods and dpnp.histogram2d - #3064

Merged
antonwolfy merged 4 commits into
masterfrom
fix-histogram2d-returns-blank-line
Sep 9, 2026
Merged

Fix documentation rendering for dpnp.ndarray operator methods and dpnp.histogram2d#3064
antonwolfy merged 4 commits into
masterfrom
fix-histogram2d-returns-blank-line

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes several documentation rendering issues.

  • dpnp.ndarray operator methods documented their behavior with a :math: role wrapping the expression in \text{...}. In LaTeX/MathJax math mode &, ^, and % are special, so __and__, __xor__, __mod__ and their variants rendered as error strings or truncated text. These are plain Python operator snippets, so they now render as inline code literals; all operator dunder docstrings were converted for consistency.
  • dpnp.histogram2d and dpnp.left_shift were missing the blank line before their Returns section, so numpydoc did not parse it as a section header.

Checklist

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

The operator dunder docstrings wrapped their expressions in a :math:
role with \text{...}. In LaTeX/MathJax math mode this breaks on
special characters: '&' is an alignment char, '^' is superscript, and
'%' starts a comment. As a result __and__, __xor__, __mod__ and their
in-place/reflected variants rendered as errors or truncated text.

Render these Python operator expressions as inline code literals
instead, which is both correct and more appropriate than math markup.
@antonwolfy
antonwolfy force-pushed the fix-histogram2d-returns-blank-line branch from fce72fe to 1af3ad8 Compare September 8, 2026 12:44
@antonwolfy antonwolfy self-assigned this Sep 8, 2026
@antonwolfy antonwolfy added this to the 0.21.0 release milestone Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/index.html

@antonwolfy
antonwolfy marked this pull request as ready for review September 8, 2026 13:42
@antonwolfy
antonwolfy marked this pull request as draft September 8, 2026 13:45
@antonwolfy
antonwolfy marked this pull request as ready for review September 8, 2026 13:51
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev8=py314ha0e2e8e_8 ran successfully.
Passed: 1376
Failed: 0
Skipped: 6

@coveralls

coveralls commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

No base build to compare — fix-histogram2d-returns-blank-line into master

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you @antonwolfy

@antonwolfy
antonwolfy merged commit af5995c into master Sep 9, 2026
97 of 110 checks passed
@antonwolfy
antonwolfy deleted the fix-histogram2d-returns-blank-line branch September 9, 2026 13:49
github-actions Bot added a commit that referenced this pull request Sep 9, 2026
…p.histogram2d (#3064)

Fixes several documentation rendering issues.

- `dpnp.ndarray` operator methods documented their behavior with a
`:math:` role wrapping the expression in `\text{...}`. In LaTeX/MathJax
math mode `&`, `^`, and `%` are special, so `__and__`, `__xor__`,
`__mod__` and their variants rendered as error strings or truncated
text. These are plain Python operator snippets, so they now render as
inline code literals; all operator dunder docstrings were converted for
consistency.
- `dpnp.histogram2d` and `dpnp.left_shift` were missing the blank line
before their `Returns` section, so numpydoc did not parse it as a
section header. af5995c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants