From c5b08514715f018fbb0b41620d0b08b54174d931 Mon Sep 17 00:00:00 2001 From: ykyohei <38639108+ykyohei@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:44:57 +0000 Subject: [PATCH] fix docstring --- socs/agents/hwp_pid/drivers/pid_controller.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/socs/agents/hwp_pid/drivers/pid_controller.py b/socs/agents/hwp_pid/drivers/pid_controller.py index 6ee6c65fe..5a7f0950c 100644 --- a/socs/agents/hwp_pid/drivers/pid_controller.py +++ b/socs/agents/hwp_pid/drivers/pid_controller.py @@ -387,7 +387,7 @@ def send_message(self, msg): msg (str): Command to send to the controller. Returns: - str: Respnose from the controller. + str: Response from the controller. """ for attempt in range(2): @@ -414,7 +414,7 @@ def return_messages(self, msg): msg (list): List of messages to decode. Returns: - list: Decoded responses. + list: DecodedResponse """ return self._decode_array(msg) @@ -442,7 +442,7 @@ def _decode_array(input_array): - W02: write setpoint for pid 2 (rotation direction setpoint) - W0C: write action type for pid 1 (how to interpret sign of (setpoint-value)) - X01: read value for pid 1 (current rotation frequency) - "?" chadacter indicates the error messages. + "?" character indicates the error messages. The helper function goes through the raw response strings and replaces them with their decoded values. @@ -450,7 +450,7 @@ def _decode_array(input_array): input_array (list): List of str messages to decode Returns: - list: Decoded responses + list: DecodedResponse """ output_array = list(input_array) @@ -491,7 +491,7 @@ def _decode_error(string): string (str): Error message type string to decode Returns: - Decoded value + DecodedResponse """ if '?+9999.' in string: @@ -528,7 +528,7 @@ def _decode_read(string): string (str): Read (hex) type string to decode Returns: - Decoded value + DecodedResponse """ end_string = string.split('\r')[-1] @@ -554,7 +554,7 @@ def _decode_write(string): string (str): Write (hex) type string to decode Returns: - str: Decoded string + DecodedResponse """ write_type = string[1:] @@ -584,7 +584,7 @@ def _decode_measure(string): string (str): Read (decimal) type string to decode Return: - float: Decoded value + DecodedReponse """ end_string = string.split('\r')[-1] measure_type = end_string[1:3]