Skip to content

Commit 330539f

Browse files
committed
docs: display __init__() method docstrings
Display the class' __init__ methods' docstrings in the online documentation. This helps users to understand the class APIs. Remove the docstring from the _XYZPacket parent class, because Sphinx was rendering that for every child class (AccelerometerPacket, GyroPacket, MagnetometerPacket, QuaternionPacket). Apparently the "autodoc_inherit_docstrings = False" setting does not work in that case.
1 parent db9029d commit 330539f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

adafruit_bluefruit_connect/_xyz_packet.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ class _XYZPacket(Packet):
4444
# _TYPE_HEADER is set by each concrete subclass.
4545

4646
def __init__(self, x, y, z):
47-
"""Construct an _XYZPacket subclass object
48-
from the given x, y, and z float values, and type character.
49-
"""
47+
# Construct an _XYZPacket subclass object
48+
# from the given x, y, and z float values, and type character.
5049
self._x = x
5150
self._y = y
5251
self._z = z

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
3030
}
3131

32+
autoclass_content = "both"
33+
3234
# Add any paths that contain templates here, relative to this directory.
3335
templates_path = ["_templates"]
3436

0 commit comments

Comments
 (0)