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

Use absolute addressing for parameters #5725

Merged
merged 3 commits into from
Nov 26, 2024
Merged

Conversation

klecki
Copy link
Contributor

@klecki klecki commented Nov 25, 2024

Category: Bug fix, Other

Description:

Injecting full qualified path to parameters solve problems with lookup of enclosing entity and generating valid links for submodules that are runtime generated.

The missing-reference resolver of sphinx paramlinks assume that source of all nodes has format:
"/path/to/file.py:docstring of module.clsname.methname" and requires the :, while members of generated DALI submodules have only the:
"docstring of nvidia.dali.fn.decoders.image"
part, so the regex doesn't match. If the reference is fully specified, the plugin doesn't need to look it up and doesn't use the unsuitable regex.

Some nvidia.dali.ops module specific code is added, so we try to always obtain the __call__ signature (it contains all inputs and kwargs) and we try to link to either class or __call__ documentation depending if we are documenting input or kwarg - as that API has this specific distinction.

Other parts of API don't have specific conventions.

One example in pipeline doc showcases the ability to reference parameters of other functions.

Additional information:

Affected modules and functionalities:

Sphinx doc generation

Key points relevant for the review:

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

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

Injecting full qualified path to parameters solve problems with lookup
of enclosing entity and generating valid links for modules that are
runtime generated.

The missing-reference resolver of sphinx paramlinks assume that `source`
of all nodes has format:
"/path/to/file.py:docstring of module.clsname.methname"
and requires the `:`, while members of generated DALI submodules have
only the:
"docstring of nvidia.dali.fn.decoders.image"
part, so the regex doesn't match. If the reference is fully specified,
the plugin doesn't need to look it up and doesn't use the unsuitable
regex.

Some nvidia.dali.ops module specific code is added, so we try to always
obtain the `__call__` signature (it contains all inputs and kwargs) and
we try to link to either class or `__call__` documentation depending if
we are documenting input or kwarg - as that API has this specific
distinction.

Other parts of API don't have specific conventions.

Signed-off-by: Krzysztof Lecki <[email protected]>
@klecki
Copy link
Contributor Author

klecki commented Nov 25, 2024

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20790935]: BUILD FAILED

@klecki
Copy link
Contributor Author

klecki commented Nov 26, 2024

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20812894]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20812894]: BUILD PASSED

@klecki
Copy link
Contributor Author

klecki commented Nov 26, 2024

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20821956]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20821956]: BUILD FAILED

@klecki
Copy link
Contributor Author

klecki commented Nov 26, 2024

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20823153]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [20823153]: BUILD PASSED

@klecki klecki merged commit 46d75f8 into NVIDIA:main Nov 26, 2024
6 of 7 checks passed
@klecki klecki deleted the paramlink-absolute branch November 26, 2024 18:03
@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