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

Separate the documentation pages! #3794

Merged
merged 6 commits into from
Apr 7, 2022
Merged

Conversation

klecki
Copy link
Contributor

@klecki klecki commented Apr 5, 2022

Category: Other

Description:

Make every operator appear as separate function
in the documentation.

Few hacks needed:

  1. Turns out that it's really hard to get the canonical
    name of the op and schema from the POV of fn API.
    So I added a _schema_name member, maybe there
    is better way to be suggested?

Now available as #3798

  1. All the pages are generated into one operations directory,
    mainly to not pollute the docs/ during build, but it has
    a side effect of appearing in the url. Do we want to inlcude
    more of it (module name) as a url hierarchy or are we fine as
    it is now?

  2. Redirect didn't work, I need a JS/HTML magician.
    This is fine now.

  3. The operations table works on the old API access
    and I have no intention of refactoring it.

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

Checklist

Tests

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

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

@klecki
Copy link
Contributor Author

klecki commented Apr 5, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4431171]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4431171]: BUILD PASSED

@@ -89,6 +89,7 @@ def fn_wrapper(*inputs, **kwargs):
fn_wrapper.__name__ = wrapper_name
fn_wrapper.__qualname__ = wrapper_name
fn_wrapper.__doc__ = wrapper_doc
fn_wrapper._schema_name = op_class.schema_name
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest passing the op_class, not just the name - that way we'd have access to whatever properties of the underlying op class we want.

Suggested change
fn_wrapper._schema_name = op_class.schema_name
fn_wrapper._op_class = op_class

Also, please add it also to op_wrapper, too. I think this code needs some cleanup after the introduction of debug mode... :\

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably this change or anything related should be made it separate PR not during docs rework.

I am a bit worried about tying the whole class to the fn functions, but those are private members, and who checks the members of the functions?

@@ -0,0 +1,21 @@
// TODO(klecki): doesn't work, how to include it?
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this meant to stay?

@klecki klecki changed the title [RFC] Separate the pages! Separate the documentation pages! Apr 6, 2022
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@klecki
Copy link
Contributor Author

klecki commented Apr 7, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4452175]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4452175]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [4452175]: BUILD PASSED

@klecki klecki merged commit ad47200 into NVIDIA:main Apr 7, 2022
cyyever pushed a commit to cyyever/DALI that referenced this pull request May 13, 2022
Make every operator function from fn API
appear as separate page in the documentation.

Add a redirect from old operator link to the
new one, mapping:
`supported_ops.html#nvidia.dali.fn.operator_name`
to:
 `operations/nvidia.dali.fn.operator_name.html`

Adjust the old style URLs in examples.

Correct few typos.

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
cyyever pushed a commit to cyyever/DALI that referenced this pull request Jun 7, 2022
Make every operator function from fn API
appear as separate page in the documentation.

Add a redirect from old operator link to the
new one, mapping:
`supported_ops.html#nvidia.dali.fn.operator_name`
to:
 `operations/nvidia.dali.fn.operator_name.html`

Adjust the old style URLs in examples.

Correct few typos.

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
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.

5 participants