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

Add missing API docs for bh.Histogram #909

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

Saransh-cpp
Copy link
Member

For some reason, the API doc of Histogram is missing from the documentation website. Histogram is in a private module, but it is exported in __init__.py. Furthermore, the module boost_histogram itself has no docstrings to display.

This was briefly mentioned in scikit-hep/hist#445.

@henryiii
Copy link
Member

Does this get removed if you rerun nox -s build_api_docs?

@Saransh-cpp
Copy link
Member Author

Oh yes, it reverts the changes. Looking into it.

@Saransh-cpp
Copy link
Member Author

Adding --private brings in every private module to the docs. We could only include hist.py by excluding other private files, but I can't see a way to exclude private members of hist.py after using --private.

The templates could be changed but the documentation for it is almost non-existent. The only available examples are in the Sphinx project, which I think were taken as it is for boost-histogram.

@henryiii
Copy link
Member

It's modified slightly, but yes, it was.

We could hack it by reading the file and then writing it after the generation step. It would still work in nox but not by hand, which IMO is fine for now.

Ideally, I'd like to get rid of the private files and instead move everything to where it is supposed to be, then use __all__ and module level __dir__ to hide the private parts. That wasn't supported everywhere when boost-histogram was written (in fact, 3.7 was probably pretty new). But that's for later.

@henryiii henryiii merged commit 4e0ff41 into scikit-hep:develop Jan 18, 2024
14 checks passed
@henryiii
Copy link
Member

Thanks!

@Saransh-cpp Saransh-cpp deleted the Histogram-API-docs branch January 19, 2024 11:22
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.

2 participants