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

Split static methods to own section in autosummary #159

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
pre-commit-ci[bot] committed Aug 14, 2024
commit 41d606b4b217a4ffcadd996cbe6a1889e132560f
18 changes: 12 additions & 6 deletions autoautosummary.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
from sphinx.ext.autosummary import Autosummary, get_documenter
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.inspect import safe_getattr, isstaticmethod
from sphinx.util.inspect import isstaticmethod, safe_getattr

# from sphinx.directives import directive
logger = logging.getLogger(__name__)
@@ -77,7 +77,14 @@ def skip_member(doc, obj: Any, name: str, options, objtype: str) -> bool:

@staticmethod
def get_members(
doc, obj, typ, options, include_public: list | None = None, signal=False, enum=False, static=False
doc,
obj,
typ,
options,
include_public: list | None = None,
signal=False,
enum=False,
static=False,
):
try:
if not include_public:
@@ -145,10 +152,9 @@ def run(self):
)
elif "static_methods" in self.options:
rubric_title = "Static Methods"
_, rubric_elems = self.get_members(self.state.document, c,
"method",
self.options,
static=True)
_, rubric_elems = self.get_members(
self.state.document, c, "method", self.options, static=True
)
elif "enums" in self.options:
rubric_title = "Enums"
_, rubric_elems = self.get_members(