From b0673e43999d2ca00bb39efaa95b5a341afd89b2 Mon Sep 17 00:00:00 2001 From: Brian Koopman Date: Mon, 27 Nov 2023 16:47:25 -0500 Subject: [PATCH] Add method signature overrides and format docstrings --- docs/agents/wiregrid_actuator.rst | 8 +++----- socs/agents/wiregrid_actuator/agent.py | 28 +++++++++++++++----------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/docs/agents/wiregrid_actuator.rst b/docs/agents/wiregrid_actuator.rst index 5ece25bcd..1bcfba852 100644 --- a/docs/agents/wiregrid_actuator.rst +++ b/docs/agents/wiregrid_actuator.rst @@ -77,10 +77,6 @@ The main functions are ``insert()`` and ``eject()``. In the both of the functions, after the inserting/ejecting, the stopper locks the actuators again. However, the motor power is not turned ON or OFF during the both functions. -The parameter details are here: -- speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2) - DO NOT use speedrate > 1.0 if el != 90 deg!! - **Test Functions** - check_limitswitch(): Check ON/OFF of the limit switches - check_stopper(): Check ON/OFF (lock/unlock) of the stoppers @@ -103,7 +99,9 @@ The parameter details are here: - distance: Actuator moving distance [mm] (default: 10) - speedrate: Actuator speed rate [0.0, 5.0] (default: 0.2) - DO NOT use speedrate > 1.0 if el != 90 deg!! + +.. warning:: + DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! Hardware Configurations diff --git a/socs/agents/wiregrid_actuator/agent.py b/socs/agents/wiregrid_actuator/agent.py index e6decf1cf..05dd5d555 100644 --- a/socs/agents/wiregrid_actuator/agent.py +++ b/socs/agents/wiregrid_actuator/agent.py @@ -280,15 +280,16 @@ def _eject(self, main_distance=920, main_speedrate=1.0): check=lambda x: 0.0 < x <= 5.0) @ocs_agent.param('high_speed', default=False, type=bool) def insert(self, session, params=None): - """insert() + """insert(speedrate=1.0, high_speed=False) **Task** - Insert the wire-grid into the forebaffle interface above the SAT. Parameters: speedrate (float): Actuator speed rate [0.0, 5.0] (default: 1.0) - DO NOT use speedrate > 1.0 if el != 90 deg!! - high_speed (bool): If False, speedrate is limited to 1.0 + DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! + high_speed (bool): If False, speedrate is limited to 1.0. Defaults + to False. """ # Get parameters speedrate = params.get('speedrate') @@ -321,15 +322,16 @@ def insert(self, session, params=None): check=lambda x: 0.0 < x <= 5.0) @ocs_agent.param('high_speed', default=False, type=bool) def eject(self, session, params=None): - """eject() + """eject(speedrate=1.0, high_speed=False) **Task** - Eject the wire-grid from the forebaffle interface above the SAT. Parameters: speedrate (float): Actuator speed rate [0.0, 5.0] (default: 1.0) - DO NOT use speedrate > 1.0 if el != 90 deg!! - high_speed (bool): If False, speedrate is limited to 1.0 + DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! + high_speed (bool): If False, speedrate is limited to 1.0. Defaults + to False. """ # Get parameters speedrate = params.get('speedrate') @@ -484,7 +486,7 @@ def eject_homing(self, session, params=None): check=lambda x: 0.0 < x <= 5.0) @ocs_agent.param('high_speed', default=False, type=bool) def insert_test(self, session, params): - """insert_test(distance=10, speedrate=0.1) + """insert_test(distance=10, speedrate=0.2, high_speed=False) **Task** - Insert slowly the wire-grid into the forebaffle interface above the SAT with a small distance. @@ -492,8 +494,9 @@ def insert_test(self, session, params): Parameters: distance (float): Actuator moving distance [mm] (default: 10) speedrate (float): Actuator speed rate [0.0, 5.0] (default: 0.2) - DO NOT use speedrate > 1.0 if el != 90 deg!! - high_speed (bool): If False, speedrate is limited to 1.0 + DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! + high_speed (bool): If False, speedrate is limited to 1.0. Defaults + to False. """ # Get parameters distance = params.get('distance') @@ -541,7 +544,7 @@ def insert_test(self, session, params): check=lambda x: 0.0 < x <= 5.0) @ocs_agent.param('high_speed', default=False, type=bool) def eject_test(self, session, params): - """eject_test(distance=10, speedrate=0.1) + """eject_test(distance=10, speedrate=0.2, high_speed=False) **Task** - Eject slowly the wire-grid from the forebaffle interface above the SAT with a small distance. @@ -549,8 +552,9 @@ def eject_test(self, session, params): Parameters: distance (float): Actuator moving distance [mm] (default: 10) speedrate (float): Actuator speed rate [0.0, 5.0] (default: 0.2) - DO NOT use speedrate > 1.0 if el != 90 deg!! - high_speed (bool): If False, speedrate is limited to 1.0 + DO NOT use ``speedrate > 1.0`` if ``el != 90 deg``! + high_speed (bool): If False, speedrate is limited to 1.0. Defaults + to False. """ # Get parameters distance = params.get('distance', 10)