Skip to content

Conversation

@vpratz
Copy link
Collaborator

@vpratz vpratz commented Feb 24, 2025

This PR implements one possible solution to the problem highlighted in #290. By specifying __all__ in the relevant files, it makes explicit which modules and functions should be documented, so that only desired functions and modules are included. This also allows setting autosummary_imported_members = False, which greatly speeds up building the documentation.

It requires manual action when:

  • a new public submodule is added: has to be added to the include_submodules list in the parent module
  • a new __init__.py is added: must add the following boilerplate at the end of the file (number of dots before utils depends on the path):
from ..utils._docs import _add_imports_to_all

_add_imports_to_all(include_modules=[])

Please give feedback on the underlying mechanism. Is this an option we would be happy with, or should we rather try something else?

@vpratz
Copy link
Collaborator Author

vpratz commented Feb 28, 2025

@LarsKue Do you have any concerns against merging this, at least as a temporary solution? As there is now an effort to complete the docs (#340), I think the quick build times enabled by this change would be nice, as they enable fast iteration and checking of the docs. Also, while the focus is on this, we are able to detect if we missed anything that should be in __all__, should we want to keep this implementation as a permanent solution.

@paul-buerkner
Copy link
Contributor

paul-buerkner commented Feb 28, 2025 via email

@LarsKue
Copy link
Contributor

LarsKue commented Feb 28, 2025

As a temporary solution, I think it is fine for now. We should not fall into the trap of having to manually maintain __all__ though.

@paul-buerkner
Copy link
Contributor

Great! Valentin, feel free to merge :-)

@vpratz vpratz marked this pull request as ready for review February 28, 2025 18:14
@vpratz vpratz merged commit 5632da3 into bayesflow-org:dev Feb 28, 2025
@vpratz vpratz deleted the feat-doc-all branch March 1, 2025 08:55
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.

3 participants