From 6cfaa72e866be19d0cb486f2b857f74372919a9b Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Mon, 5 Aug 2024 20:36:20 -0700 Subject: [PATCH] [docs] combine `__init__()` signature with class names --- circuitpython_mocks/board.py | 8 ++++---- docs/busio.rst | 6 +++--- docs/conf.py | 3 ++- docs/digitalio.rst | 2 -- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/circuitpython_mocks/board.py b/circuitpython_mocks/board.py index b6ecae2..e4285d2 100644 --- a/circuitpython_mocks/board.py +++ b/circuitpython_mocks/board.py @@ -172,28 +172,28 @@ class Pin: def SPI(): - """Creates a default instance of :py:class:`~busio.SPI`""" + """Creates a default instance (singleton) of :py:class:`~busio.SPI`""" from circuitpython_mocks.busio import SPI as ImplSPI return ImplSPI(SCK, MOSI, MISO) def I2C(): - """Creates a default instance of :py:class:`~busio.I2C`""" + """Creates a default instance (singleton) of :py:class:`~busio.I2C`""" from circuitpython_mocks.busio import I2C as ImplI2C return ImplI2C(SCL, SDA) def STEMMA_I2C(): - """Creates a default instance of :py:class:`~busio.I2C`""" + """Creates a default instance (singleton) of :py:class:`~busio.I2C`""" from circuitpython_mocks.busio import I2C as ImplI2C return ImplI2C(SCL1, SDA1) def UART(): - """Creates a default instance of :py:class:`~busio.UART`""" + """Creates a default instance (singleton) of :py:class:`~busio.UART`""" from circuitpython_mocks.busio import UART as ImplUART return ImplUART(TX, RX) diff --git a/docs/busio.rst b/docs/busio.rst index 328770e..fae3ad9 100644 --- a/docs/busio.rst +++ b/docs/busio.rst @@ -4,11 +4,11 @@ .. automodule:: circuitpython_mocks.busio .. autoclass:: circuitpython_mocks.busio.I2C - :members: __init__, readfrom_into, writeto, writeto_then_readfrom, scan + :members: readfrom_into, writeto, writeto_then_readfrom, scan .. autoclass:: circuitpython_mocks.busio.SPI - :members: __init__, readinto, write, write_readinto, configure, frequency + :members: readinto, write, write_readinto, configure, frequency .. autoclass:: circuitpython_mocks.busio.UART - :members: __init__, readinto, readline, write + :members: readinto, readline, write .. py:class:: circuitpython_mocks.busio.UART.Parity diff --git a/docs/conf.py b/docs/conf.py index aeb04c9..07d417c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,10 +20,11 @@ "sphinx_immaterial", "sphinx.ext.autodoc", "sphinx.ext.intersphinx", + "sphinx.ext.viewcode", "sphinx_jinja", ] -autodoc_class_signature = "separated" +# autodoc_class_signature = "separated" autodoc_default_options = { "exclude-members": "__new__", } diff --git a/docs/digitalio.rst b/docs/digitalio.rst index 4907060..0ae48d7 100644 --- a/docs/digitalio.rst +++ b/docs/digitalio.rst @@ -40,6 +40,4 @@ .. automodule:: circuitpython_mocks.digitalio.operations .. autoclass:: circuitpython_mocks.digitalio.operations.SetState - :members: __init__ .. autoclass:: circuitpython_mocks.digitalio.operations.GetState - :members: __init__