Skip to content

Commit

Permalink
Write docstring for PTC class
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianJKoopman committed Oct 7, 2024
1 parent a09ec04 commit 54027b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/agents/cryomech_cpa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ Supporting APIs

.. autoclass:: socs.agents.cryomech_cpa.agent.PTC
:members:
:show-inheritance:
24 changes: 23 additions & 1 deletion socs/agents/cryomech_cpa/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@


class PTC(TCPInterface):
"""Interface class for connecting to the pulse tube compressor.
Parameters
----------
ip_address : str
IP address of the device.
port : int
Associated port for TCP communication. Default is 502.
timeout : float
Duration in seconds that operations wait before giving up. Default is
10 seconds.
fake_errors : bool
Flag that generates random fake errors if True. Does not generate
errors if False. Defaults to False.
Attributes
----------
comm : socket.socket
Socket object that forms the connection to the compressor.
"""

def __init__(self, ip_address, port=502, timeout=10, fake_errors=False):
self.fake_errors = fake_errors

Expand All @@ -28,7 +50,7 @@ def __init__(self, ip_address, port=502, timeout=10, fake_errors=False):

def get_data(self):
"""
Gets the raw data from the ptc and returns it in a usable format.
Gets the raw data from the PTC and returns it in a usable format.
"""
self.send(self.buildRegistersQuery())
data = self.recv()
Expand Down

0 comments on commit 54027b0

Please sign in to comment.