From 0082f0502a4f9d809dfe9831c8665aef1f067ee6 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Sun, 14 Feb 2021 18:44:25 +0100 Subject: [PATCH] doc/parameters/Direction: move doc to rst --- doc/api/parameters/direction.rst | 19 +++++++++++++++++-- pybricks/parameters.py | 22 ++++------------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/doc/api/parameters/direction.rst b/doc/api/parameters/direction.rst index 331d9e8..28edbe4 100644 --- a/doc/api/parameters/direction.rst +++ b/doc/api/parameters/direction.rst @@ -1,8 +1,23 @@ Direction ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -.. autoclass:: pybricks.parameters.Direction - :no-members: +.. class:: Direction + + Rotational direction for positive speed or angle values. + + .. autoattribute:: pybricks.parameters.Direction.CLOCKWISE + :annotation: + + .. autoattribute:: pybricks.parameters.Direction.COUNTERCLOCKWISE + :annotation: + + +--------------------------------+-------------------+-----------------+ + | ``positive_direction =`` | Positive speed: | Negative speed: | + +================================+===================+=================+ + | ``Direction.CLOCKWISE`` | clockwise | counterclockwise| + +--------------------------------+-------------------+-----------------+ + | ``Direction.COUNTERCLOCKWISE`` | counterclockwise | clockwise | + +--------------------------------+-------------------+-----------------+ In general, clockwise is defined by **looking at the motor shaft, just like looking at a clock**. Some motors have two shafts. If in doubt, diff --git a/pybricks/parameters.py b/pybricks/parameters.py index 54b7280..d85d12b 100644 --- a/pybricks/parameters.py +++ b/pybricks/parameters.py @@ -111,27 +111,13 @@ class Stop(_PybricksEnum): class Direction(_PybricksEnum): - """Rotational direction for positive speed or angle values. - - .. data:: CLOCKWISE - - A positive speed value should make the motor move clockwise. - - .. data:: COUNTERCLOCKWISE - - A positive speed value should make the motor move counterclockwise. - - +--------------------------------+-------------------+-----------------+ - | ``positive_direction =`` | Positive speed: | Negative speed: | - +================================+===================+=================+ - | ``Direction.CLOCKWISE`` | clockwise | counterclockwise| - +--------------------------------+-------------------+-----------------+ - | ``Direction.COUNTERCLOCKWISE`` | counterclockwise | clockwise | - +--------------------------------+-------------------+-----------------+ - """ + """Rotational direction for positive speed or angle values.""" CLOCKWISE = 0 + """A positive speed value should make the motor move clockwise.""" + COUNTERCLOCKWISE = 1 + """A positive speed value should make the motor move counterclockwise.""" class Button(_PybricksEnum):