From 9b6052afbc4b10ca17270982432b6cb52be17370 Mon Sep 17 00:00:00 2001 From: Jack Lashner Date: Wed, 23 Oct 2024 09:35:46 -0400 Subject: [PATCH] Document agent API in action class docstrings --- docs/agents/lakeshore240.rst | 5 ++++- socs/agents/lakeshore240/agent.py | 29 ++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/agents/lakeshore240.rst b/docs/agents/lakeshore240.rst index 3cac61b9d..3822986e6 100644 --- a/docs/agents/lakeshore240.rst +++ b/docs/agents/lakeshore240.rst @@ -119,7 +119,10 @@ client that sets Channel 1 of a 240 to read a diode:: Agent API --------- -.. autoclass:: socs.agents.lakeshore240.agent.LS240_Agent +.. autoclass:: socs.agents.lakeshore240.agent.UploadCalCurve + :members: + +.. autoclass:: socs.agents.lakeshore240.agent.SetValues :members: Supporting APIs diff --git a/socs/agents/lakeshore240/agent.py b/socs/agents/lakeshore240/agent.py index 79d7ef64a..ec5f57a9b 100644 --- a/socs/agents/lakeshore240/agent.py +++ b/socs/agents/lakeshore240/agent.py @@ -29,9 +29,13 @@ def process(self, module: Module) -> None: @dataclass class UploadCalCurve(LS240Action): - """upload_cal_curve(channel, filename) + """ + **OCS Task** + + Action class to Upload a calibration curve to a channel. This is an OCS + Task that can be run through a client as follows:: - **Task** - Upload a calibration curve to a channel. + >> client.upload_cal_curve(channel=channel, filename=filename) Args ------ @@ -40,7 +44,6 @@ class UploadCalCurve(LS240Action): filename (str): Filename for calibration curve. """ - channel: int filename: str @@ -53,10 +56,22 @@ def process(self, module: Module) -> None: @dataclass class SetValues(LS240Action): - """set_values(channel, sensor=None, auto_range=None, range=None,\ - current_reversal=None, units=None, enabled=None, name=None) - - **Task** - Set sensor parameters for a Lakeshore240 Channel. + """ + **OCS TASK** + + Action class for setting sensor parameters for a Lakeshore240 Channel. + This can be called through an OCS client using:: + + >> client.set_values( + channel=channel, + sensor=sensor, + auto_range=auto_range, + range=range, + current_reversal=current_reversal, + units=units, + enabled=enabled, + name=name, + ) Args ---------