Skip to content

Commit

Permalink
[docs] combine __init__() signature with class names
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Aug 6, 2024
1 parent 22c4790 commit 6cfaa72
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions circuitpython_mocks/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 3 additions & 3 deletions docs/busio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__",
}
Expand Down
2 changes: 0 additions & 2 deletions docs/digitalio.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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__

0 comments on commit 6cfaa72

Please sign in to comment.