Skip to content

Conversation

@mjohanse-emr
Copy link
Collaborator

@mjohanse-emr mjohanse-emr commented Jul 21, 2025

What does this Pull Request accomplish?

Add the following files to a docs folder under packages/ni.protobuf.types:

  • conf.py (sphinx config)
  • index.rst (top level page)
  • intro.inc (intro include file)

Add a new workflow file check_docs.yml that takes a package name input and creates/uploads the docs for that package using sphinx. I also added a new step in CI.yml to call into this new workflow.

Why should this Pull Request be merged?

Implements part of AB#3166742

What testing has been done?

I generated the docs manually and performed a visual inspection. They look pretty good considering most of the functions are code-generated.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 21, 2025

Test Results

   34 files  ±0     34 suites  ±0   46s ⏱️ -2s
   88 tests ±0     88 ✅ ±0  0 💤 ±0  0 ❌ ±0 
1 200 runs  ±0  1 200 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 4046875. ± Comparison against base commit f7b00ad.

♻️ This comment has been updated with latest results.

@mjohanse-emr mjohanse-emr marked this pull request as ready for review July 22, 2025 20:06
@mjohanse-emr mjohanse-emr requested a review from bkeryan July 23, 2025 13:56
@jfriedri-ni
Copy link
Collaborator

It looks like imported types are being treated as defined types in the conversion submodule. Shouldn't this doc page only have the conversion functions?

image

@mjohanse-emr
Copy link
Collaborator Author

It looks like imported types are being treated as defined types in the conversion submodule. Shouldn't this doc page only have the conversion functions?

image

Weird. I should try and get those to no longer show up. It only looks like the types from this package are listed, not all imported types. Notice that the classes imported from nitypes don't show up.

@bkeryan
Copy link
Collaborator

bkeryan commented Jul 23, 2025

It looks like imported types are being treated as defined types in the conversion submodule. Shouldn't this doc page only have the conversion functions?
image

Weird. I should try and get those to no longer show up. It only looks like the types from this package are listed, not all imported types. Notice that the classes imported from nitypes don't show up.

Try setting __all__.
https://sphinx-autoapi.readthedocs.io/en/latest/how_to.html#set-all

@bkeryan
Copy link
Collaborator

bkeryan commented Jul 23, 2025

It looks like imported types are being treated as defined types in the conversion submodule. Shouldn't this doc page only have the conversion functions?
image

Weird. I should try and get those to no longer show up. It only looks like the types from this package are listed, not all imported types. Notice that the classes imported from nitypes don't show up.

In measurement-plugin-python we had to use autoapi-skip-member to handle classes that are exported from multiple modules, but I don't know why sphinx-autoapi thinks these types are imported in waveform_conversion.

https://github.com/ni/measurement-plugin-python/blob/main/packages/service/_docs_source/conf.py#L57

@mjohanse-emr
Copy link
Collaborator Author

It looks like imported types are being treated as defined types in the conversion submodule. Shouldn't this doc page only have the conversion functions?
image

Weird. I should try and get those to no longer show up. It only looks like the types from this package are listed, not all imported types. Notice that the classes imported from nitypes don't show up.

Try setting __all__. https://sphinx-autoapi.readthedocs.io/en/latest/how_to.html#set-all

Setting __all__ didn't change anything. Do I have to set it in a specific place? I tried just setting it in waveform_conversion.py below the imports, but it still lists all the methods, not just the one I put in __all__ to test it out.

@mjohanse-emr
Copy link
Collaborator Author

It looks like imported types are being treated as defined types in the conversion submodule. Shouldn't this doc page only have the conversion functions?
image

Weird. I should try and get those to no longer show up. It only looks like the types from this package are listed, not all imported types. Notice that the classes imported from nitypes don't show up.

Try setting __all__. https://sphinx-autoapi.readthedocs.io/en/latest/how_to.html#set-all

Setting __all__ didn't change anything. Do I have to set it in a specific place? I tried just setting it in waveform_conversion.py below the imports, but it still lists all the methods, not just the one I put in __all__ to test it out.

I think it has something to do with the custom template I implemented. If I comment out

# autoapi_python_use_implicit_namespaces = True
# autoapi_template_dir = "templates/autoapi"

Then the imported types don't get shown. However, then we are back at our original problem of everything being types.X instead of ni.protobuf.types.X.

@bkeryan
Copy link
Collaborator

bkeryan commented Jul 23, 2025

It looks like imported types are being treated as defined types in the conversion submodule. Shouldn't this doc page only have the conversion functions?
image

Weird. I should try and get those to no longer show up. It only looks like the types from this package are listed, not all imported types. Notice that the classes imported from nitypes don't show up.

Try setting __all__. https://sphinx-autoapi.readthedocs.io/en/latest/how_to.html#set-all

Setting __all__ didn't change anything. Do I have to set it in a specific place? I tried just setting it in waveform_conversion.py below the imports, but it still lists all the methods, not just the one I put in __all__ to test it out.

I think it has something to do with the custom template I implemented. If I comment out

# autoapi_python_use_implicit_namespaces = True
# autoapi_template_dir = "templates/autoapi"

Then the imported types don't get shown. However, then we are back at our original problem of everything being types.X instead of ni.protobuf.types.X.

I think the custom template removes some logic from the original template that we still want. You should compare the original and custom templates and see what's missing.

Michael Johansen added 2 commits July 23, 2025 16:09
…m exclusions for classes in conversion python files.

Signed-off-by: Michael Johansen <[email protected]>
Signed-off-by: Michael Johansen <[email protected]>
@mjohanse-emr mjohanse-emr merged commit f93a4f6 into main Jul 23, 2025
20 checks passed
@mjohanse-emr mjohanse-emr deleted the users/mjohanse/add_docs branch July 23, 2025 21:28
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.

4 participants