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

Many C++ methods have no description in docs #171

Open
landreman opened this issue Dec 10, 2021 · 2 comments
Open

Many C++ methods have no description in docs #171

landreman opened this issue Dec 10, 2021 · 2 comments
Assignees

Comments

@landreman
Copy link
Contributor

There are a bunch of methods defined in C++, such as gamma() for surfaces and curves, that do not have any description in the API docs, or when a user uses help().

@landreman
Copy link
Contributor Author

Do we want only the functions without _impl to appear in the API docs?

@smiet
Copy link
Contributor

smiet commented Oct 23, 2023

Hi @landreman, @florianwechsung,

I would love to get on this (part-time), I rely on the docstrings of functions a lot!

Won't be an overnight thing, but I am planning on making a branch cpp_docstrings (that others are of course also free to help with!)

Before I get started, I quickly want to run the strategy by you, as I see three different ways to do the documentation:

  1. directly add docstrings in the python.cpp and python_[subclass].cpp files, by including it in the m.def() declarations, where the module is defined.

    • Pros: quick. Exsisting documentation is is defined like this
    • Cons: The module definition will become very long and hard to read. documentation far from source, though still cluttering code.
  2. Add the documentation to the .h files using the `PYBIND11_DOC(my_function, "some documentation")' macro above each function header definition

    • Pros: uses intended Pybind11 conventions. Documentation close to source related to it.
    • Cons: lots. of. files. to. visit.
  3. Generate docstrings themselves using sfinx, starting with @autodoc.docstring decorators.

    • Pros: immediately adds basic documentation, documentation neatly separated from source.
    • Cons: Another dependency. Unfamiliar to me. Adds extra dependency on sfinx also for running(?)

Which option is best in your opinion? I am leaning towards option 2, comments are welcome.

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

No branches or pull requests

3 participants