doc: drop default argument in docstring

This is visible in the function definition, so no need to repeat it.
This commit is contained in:
Laurens Valk
2020-03-15 20:35:36 +01:00
parent 0c611fabab
commit 9dd1f45ccd
5 changed files with 28 additions and 35 deletions
+20 -26
View File
@@ -34,8 +34,7 @@ class DCMotor:
"""Stop the motor.
Arguments:
stop_type (Stop): Whether to coast, brake, or hold (*Default*:
:class:`Stop.COAST <.parameters.Stop>`).
stop_type (Stop): Whether to coast, brake, or hold.
"""
pass
@@ -154,9 +153,9 @@ class Motor(DCMotor):
port (Port): Port to which the motor is connected.
positive_direction (Direction): Which direction the motor should
turn when you give a positive speed value or
angle (*Default*: ``Direction.CLOCKWISE``).
angle.
gears (list):
List of gears linked to the motor (*Default*:``None``).
List of gears linked to the motor.
For example: ``[12, 36]`` represents a gear train with a
12-tooth and a 36-tooth gear. Use a list of lists for multiple
@@ -199,8 +198,7 @@ class Motor(DCMotor):
"""Stop the motor.
Arguments:
stop_type (Stop): Whether to coast, brake, or hold (*Default*:
:class:`Stop.HOLD <.parameters.Stop>`).
stop_type (Stop): Whether to coast, brake, or hold.
"""
pass
@@ -221,10 +219,9 @@ class Motor(DCMotor):
speed (:ref:`speed`): Speed of the motor.
time (:ref:`time`): Duration of the maneuver.
stop_type (Stop): Whether to coast, brake, or hold after coming to
a standstill (*Default*:
:class:`Stop.HOLD <.parameters.Stop>`).
a standstill.
wait (bool): Wait for the maneuver to complete before continuing
with the rest of the program (*Default*: ``True``).
with the rest of the program.
"""
pass
@@ -237,10 +234,9 @@ class Motor(DCMotor):
rotation_angle (:ref:`angle`): Angle by which the motor should
rotate.
stop_type (Stop): Whether to coast, brake, or hold after coming to
a standstill (*Default*:
:class:`Stop.HOLD <.parameters.Stop>`).
a standstill.
wait (bool): Wait for the maneuver to complete before continuing
with the rest of the program (*Default*: ``True``).
with the rest of the program.
"""
pass
@@ -256,11 +252,10 @@ class Motor(DCMotor):
target_angle (:ref:`angle`): Angle that the motor should
rotate to.
stop_type (Stop): Whether to coast, brake, or hold after coming to
a standstill (*Default*:
:class:`Stop.HOLD <.parameters.Stop>`).
a standstill.
wait (bool): Wait for the motor to reach the target
before continuing with the rest of the
program (*Default*: ``True``).
program.
"""
pass
@@ -271,8 +266,7 @@ class Motor(DCMotor):
Arguments:
speed (:ref:`speed`): Speed of the motor.
stop_type (Stop): Whether to coast, brake, or hold after coming to
a standstill (*Default*:
:class:`Stop.COAST <.parameters.Stop>`).
a standstill.
duty_limit (:ref:`percentage`): Torque limit during this
command. This is useful to avoid applying the full motor
torque to a geared or lever mechanism.
@@ -310,10 +304,10 @@ class Speaker:
Arguments:
frequency (:ref:`frequency`):
Frequency of the beep (*Default*: 500). Frequencies below 100
Frequency of the beep. Frequencies below 100
are treated as 100.
duration (:ref:`time`):
Duration of the beep (*Default*: 100). If the duration is less
Duration of the beep. If the duration is less
than 0, then the method returns immediately and the frequency
play continues to play indefinitely.
"""
@@ -388,7 +382,7 @@ class Speaker:
Which volume to set. ``'Beep'`` sets the volume for
:meth:`beep` and :meth:`play_notes`. ``'PCM'`` sets the volume
for :meth:`play_file` and :meth:`say`. ``'_all_'`` sets both
at the same time (*Default*: ``'_all_'``).
at the same time.
"""
pass
@@ -401,7 +395,7 @@ class Light:
Arguments:
brightness (:ref:`brightness`):
Brightness of the light (*Default*: 100).
Brightness of the light.
"""
def off(self):
@@ -452,7 +446,7 @@ class LightArray:
Arguments:
brightness (:ref:`brightness`):
Brightness of the lights (*Default*: 100).
Brightness of the lights.
"""
pass
@@ -490,7 +484,7 @@ class LightGrid:
Arguments:
matrix (2D Array): Matrix of intensities (:ref:`brightness`).
clear (bool): Whether to turn off all the lights before showing
the new image (*Default*: ``True``). If you choose ``False``,
the new image. If you choose ``False``,
the given matrix is added to one already shown.
"""
pass
@@ -510,7 +504,7 @@ class LightGrid:
Arguments:
brightness (:ref:`brightness`):
Brightness of the lights (*Default*: 100).
Brightness of the lights.
"""
pass
@@ -612,7 +606,7 @@ class Accelerometer:
Arguments:
axis (Axis): Axis along which the acceleration is
measured. (*Default*: ``axis=Axis.ALL``)
measured.
Returns:
:ref:`linacceleration`. Returns a :ref:`scalar` of the acceleration
along the specified axis.
@@ -704,7 +698,7 @@ class IMU(Accelerometer):
Arguments:
axis (Axis): Axis along which the angular velocity is
measured. (*Default*: ``axis=Axis.ALL``)
measured.
Returns:
:ref:`speed`. Returns a :ref:`scalar` of the angular velocity
along the specified axis.
+2 -2
View File
@@ -161,7 +161,7 @@ class GyroSensor:
port (Port): Port to which the sensor is connected.
positive_direction (Direction):
Positive rotation direction when looking at the red dot on top
of the sensor (*Default*: Direction.CLOCKWISE).
of the sensor.
"""
pass
@@ -227,7 +227,7 @@ class UltrasonicSensor:
Arguments:
silent (bool): Choose ``True`` to turn the sensor off after
measuring the distance. Choose ``False`` to leave
the sensor on (*Default*). When you choose
the sensor on. When you choose
``silent=True``, the sensor does not
emit sounds waves except when taking the
measurement. This reduces interference with other
+4 -4
View File
@@ -138,7 +138,7 @@ class I2CDevice:
Arguments:
reg (``int``): Register at which to begin
reading: 0--255 or 0x00--0xFF.
length (``int``): How many bytes to read (*Default*: ``1``).
length (``int``): How many bytes to read.
Returns:
``bytes``: Bytes returned from the device.
@@ -151,7 +151,7 @@ class I2CDevice:
Arguments:
reg (``int``): Register at which to begin
writing: 0--255 or 0x00--0xFF.
data (``bytes``): Bytes to be written (*Default*: ``None``).
data (``bytes``): Bytes to be written.
"""
pass
@@ -167,7 +167,7 @@ class UARTDevice:
baudrate (int): Baudrate of the UART device.
timeout (:ref:`time`): How long to wait
during :meth:`.read` before giving up. If you choose ``None``,
it will wait forever (*Default*: ``None``).
it will wait forever.
"""
pass
@@ -179,7 +179,7 @@ class UARTDevice:
exception is raised.
Arguments:
length (``int``): How many bytes to read (*Default*: ``1``).
length (``int``): How many bytes to read.
Returns:
``bytes``: Bytes returned from the device.
+1 -1
View File
@@ -160,7 +160,7 @@ class SoundSensor:
Arguments:
audible_only (bool): Detect only audible sounds. This tries to
filter out frequencies that cannot be heard by the
human ear. (*Default*: True).
human ear.
Returns:
:ref:`percentage`: Sound intensity.
+1 -2
View File
@@ -50,8 +50,7 @@ class DriveBase:
"""Stop the robot.
Arguments:
stop_type (Stop): Whether to coast, brake, or hold (*Default*:
:class:`Stop.HOLD <.parameters.Stop>`).
stop_type (Stop): Whether to coast, brake, or hold.
"""
pass