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

PyQIR generator documentation is incomplete #62

Closed
bamarsha opened this issue Feb 24, 2022 · 3 comments · Fixed by #155
Closed

PyQIR generator documentation is incomplete #62

bamarsha opened this issue Feb 24, 2022 · 3 comments · Fixed by #155
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@bamarsha
Copy link
Contributor

bamarsha commented Feb 24, 2022

The documentation at https://qir-alliance.github.io/pyqir/api-reference/generator.html is missing parameters, types and docstrings. This is likely because Sphinx can't read .pyi files for autodoc sections: sphinx-doc/sphinx#7630

@bamarsha bamarsha added bug Something isn't working documentation Improvements or additions to documentation labels Feb 24, 2022
@LaurentAjdnik
Copy link
Contributor

I looked around but indeed found no way to generate docs from .pyi files with Sphinx.

But I feel like this is possible from "docstrings" included in the Rust source itself.

The Fastobo project seems to have achieved this.

For instance, with the load_graph() function:

Their conf.py file is here.

@idavis
Copy link
Collaborator

idavis commented Jun 14, 2022

@SamarSha @cgranade - What @LaurentAjdnik shows here is pretty interesting. Do you have any thoughts on this? Might be a better option than hoping sphinx adds .pyi support.

@bamarsha
Copy link
Contributor Author

Rust doc comments will get attached as Python docstrings, but I think we'll still need to duplicate the types in both the docstring and the .pyi file. I'm also not sure how it will work when referring to Mypy type aliases defined in Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants