Skip to content

Commit 5e290fb

Browse files
committed
Fixes for sphinx autodoc
1 parent 8a4b875 commit 5e290fb

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

mirte_robot/robot.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def get_instance(*args, **kwargs):
5050

5151
return get_instance
5252

53-
@singleton
53+
# We should not decorate the class here with @singleton. That will
54+
# prevent sphinx autodoc from generating the docs for this class.
5455
class Robot:
5556
"""Robot API
5657
@@ -66,12 +67,12 @@ class Robot:
6667
def __init__(
6768
self, machine_namespace: Optional[str] = None, hardware_namespace: str = "io"
6869
):
69-
"""Intialize the Mirte Robot API
70+
"""Intialize the Mirte Robot API"""
71+
72+
# Parameters:
73+
# machine_namespace (Optional[str], optional): The Namespace from '/' to the ROS namespace for the specific Mirte. Defaults to "/{HOSTNAME}". (This only has to be changed when running the Robot API from a different machine directly. It is configured correctly for the Web interface)
74+
# hardware_namespace (str, optional): The namespace for the hardware peripherals. Defaults to "io".
7075

71-
Parameters:
72-
machine_namespace (Optional[str], optional): The Namespace from '/' to the ROS namespace for the specific Mirte. Defaults to "/{HOSTNAME}". (This only has to be changed when running the Robot API from a different machine directly. It is configured correctly for the Web interface)
73-
hardware_namespace (str, optional): The namespace for the hardware peripherals. Defaults to "io".
74-
"""
7576
self._machine_namespace = "" #(
7677
# machine_namespace
7778
# if machine_namespace and validate_namespace(machine_namespace)
@@ -587,10 +588,8 @@ def getAnalogPinValue(
587588
pin (str): The pin number of an analog pin as printed on the microcontroller.
588589
mode (str, optional): The units of the value, can be "percentage", "raw" or "voltage". Defaults to "percentage".
589590
590-
# FIXME: HOW TO DO DOCS
591591
Returns:
592-
int: RAW
593-
float: Value between 0-5V (Arduino) or 0-3.3V (Pico).
592+
int | float: Value of the pin (0-100 when percentage, 0-<max_mcu_value> when raw, 0-<max_mcu_voltage>V when voltage).
594593
"""
595594

596595
response: GetAnalogPinValue.Response = self._call_service(
@@ -849,5 +848,5 @@ def createRobot(
849848
"""
850849

851850
global mirte
852-
mirte = Robot(machine_namespace, hardware_namespace)
851+
mirte = singleton(Robot(machine_namespace, hardware_namespace))
853852
return mirte

0 commit comments

Comments
 (0)