From 0edddbb0c28588cb64c7cd4bd03975aaebfcc05a Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Fri, 23 Jul 2021 14:51:21 +0200 Subject: [PATCH] pybricks.common.Control: Fix scale doc. Document it as an attribute instead of in the main docstring. This way we can choose where it shows up in the docs. --- doc/main/motors.rst | 3 +++ src/pybricks/_common.py | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/doc/main/motors.rst b/doc/main/motors.rst index a427b97..06d5177 100644 --- a/doc/main/motors.rst +++ b/doc/main/motors.rst @@ -25,6 +25,9 @@ the settings. .. autoclass:: pybricks._common.Control :no-members: + .. autoattribute:: pybricks._common.Control.scale + :annotation: + .. rubric:: Status .. automethod:: pybricks._common.Control.done diff --git a/src/pybricks/_common.py b/src/pybricks/_common.py index 16a673e..962d2fc 100644 --- a/src/pybricks/_common.py +++ b/src/pybricks/_common.py @@ -90,13 +90,13 @@ class DCMotor: class Control: - """Class to interact with PID controller and settings. + """Class to interact with PID controller and settings.""" - .. data:: scale - - Scaling factor between the controlled integer variable - and the physical output. For example, for a single - motor this is the number of encoder pulses per degree of rotation. + scale = 1.0 + """ + Scaling factor between the controlled integer variable + and the physical output. For example, for a single + motor this is the number of encoder pulses per degree of rotation. """ def limits(self, speed, acceleration, duty, torque):