Skip to content

Commit

Permalink
docs: add missing API docs for bh.Histogram (#909)
Browse files Browse the repository at this point in the history
* Add missing API docs for bh.Histogram

* Add API docs of Histogram after the generation step
  • Loading branch information
Saransh-cpp authored Jan 18, 2024
1 parent 7440c73 commit 4e0ff41
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/api/boost_histogram.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
boost\_histogram
================

.. automodule:: boost_histogram
:members:
.. automodule:: boost_histogram._internal.hist
:members: Histogram
:undoc-members:
:show-inheritance:

Expand Down
15 changes: 15 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
import shutil
from pathlib import Path

import nox

Expand Down Expand Up @@ -99,6 +100,20 @@ def build_api_docs(session: nox.Session) -> None:
"../src/boost_histogram",
)

# add API docs of boost_histogram._internal.hist.Histogram after
# the generation step
with Path("api/boost_histogram.rst").open("r+") as f:
lines = f.readlines()
for i in range(len(lines)):
if lines[i] == ".. automodule:: boost_histogram\n":
lines[i] = ".. automodule:: boost_histogram._internal.hist\n"
lines[i + 1] = " :members: Histogram\n"
break

f.truncate(0)
f.seek(0)
f.writelines(lines)


@nox.session
def lint(session: nox.Session) -> None:
Expand Down

0 comments on commit 4e0ff41

Please sign in to comment.