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

Add handling of parameter references in Sphinx documentation #5707

Merged
merged 4 commits into from
Nov 19, 2024

Conversation

klecki
Copy link
Contributor

@klecki klecki commented Nov 12, 2024

Category: Other

Description:

Utilize sphinx_paramlinks plugin which adds:

  • link target for every parameter
  • new :paramref: directive rendering the parameter as a link (monospaced highlight)

Add hook that automatically injects :paramref: before every single-backticked parameter reference.

The references are validated against function signature. If the signature is unavaliable than the whole step is skipped.

Fix the numpydoc generation - no single ticks are required in the parameter documentation sections.

TODO:

  • some debug prints to be removed
  • install the plugin in the doc-build env.
  • detickyfy the handwritten docs (like external source)

Example

random_bbox_crop documentation source:
dali/operators/image/crop/bbox_crop.cc:175

The third output contains the bounding boxes, after filtering them out by centroid or area thresholding
(see `bbox_prune_threshold` argument), and with the coordinates mapped to the new coordinate space.

Result:
obraz
(The link works)

Or:
obraz

Additional information:

Affected modules and functionalities:

Docs, sphinx

Key points relevant for the review:

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A
    Just take a look at the docs

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

Utilize sphinx_paramlinks plugin which adds:
* link target for every parameter
* new :paramref: directive

Add hook that automatically injects :paramref: before every
single-backticked parameter reference.

The references are validated against function signature. If the
signature is unavaliable than the whole step is skipped.

TODO: some debug prints to be removed

Signed-off-by: Krzysztof Lecki <[email protected]>
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Signed-off-by: Krzysztof Lecki <[email protected]>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20356745]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20356745]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20434066]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20434066]: BUILD PASSED

@klecki
Copy link
Contributor Author

klecki commented Nov 18, 2024

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20518115]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20518115]: BUILD PASSED

@klecki klecki merged commit b543839 into NVIDIA:main Nov 19, 2024
6 of 7 checks passed
@klecki klecki added the Sphinx label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants