Skip to content

Commit 4503f87

Browse files
committed
Fixed missing sphinx docstring for Python class
1 parent 0cfa693 commit 4503f87

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/api.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,5 @@ stimped
155155
gpu_stimp
156156
=========
157157

158-
.. autofunction:: stumpy.gpu_stimp
158+
.. autofunction:: stumpy.gpu_stimp(T, min_m=3, max_m=None, step=1, device_id=0)
159+

stumpy/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,21 @@
138138
gpu_aampdist.__doc__ = ast.get_docstring(fd)
139139

140140
# Fix GPU-STIMP Docs
141+
# Note that this is a special case for class definitions.
142+
# See above for function definitions.
141143
gpu_stimp.__doc__ = ""
142144
filepath = pathlib.Path(__file__).parent / "gpu_stimp.py"
143145

144146
file_contents = ""
145147
with open(filepath, encoding="utf8") as f:
146148
file_contents = f.read()
147149
module = ast.parse(file_contents)
148-
function_definitions = [
149-
node for node in module.body if isinstance(node, ast.FunctionDef)
150+
class_definitions = [
151+
node for node in module.body if isinstance(node, ast.ClassDef)
150152
]
151-
for fd in function_definitions:
152-
if fd.name == "gpu_stimp":
153-
gpu_aampdist.__doc__ = ast.get_docstring(fd)
153+
for cd in class_definitions:
154+
if cd.name == "gpu_stimp":
155+
gpu_stimp.__doc__ = ast.get_docstring(cd)
154156

155157
try:
156158
_dist = get_distribution("stumpy")

0 commit comments

Comments
 (0)