diff --git a/setup.py b/setup.py index 11c56f3..572ffc0 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name="yinstruments", packages=find_packages(), - version="1.6.4", + version="1.7.0", description="Experiment device control scripts for BYU's Configurable Computing Lab (https://ccl.byu.edu/)", author="Jeff Goeders", author_email="jeff.goeders@gmail.com", diff --git a/yinstruments/pdu/lindy.py b/yinstruments/pdu/lindy.py index 9e5c31f..60c18b3 100644 --- a/yinstruments/pdu/lindy.py +++ b/yinstruments/pdu/lindy.py @@ -8,15 +8,17 @@ # standard OID for the functions we will be doing OID = "iso.3.6.1.4.1.17420.1.2.9.1.13.0" +DEFAULT_COMMAND_DELAY = 5.0 # This is delay needed by the lindy. + class Lindy(PDU): """This is the Lindy class""" - def __init__(self, ip_address, port, timeout=3.0): - super().__init__(ip_address, port) + def __init__(self, ip_address, timeout=3.0): + super().__init__(ip_address, command_delay=DEFAULT_COMMAND_DELAY) def __str__(self): - return f"{self.ip_address}:{self.port}" + return f"{self.ip_address}" def on(self, port_num): if int(port_num) > 8: # Since we are working with the LindyIPowerClassic8, diff --git a/yinstruments/pdu/netbooter.py b/yinstruments/pdu/netbooter.py index b76b074..9d8cab3 100644 --- a/yinstruments/pdu/netbooter.py +++ b/yinstruments/pdu/netbooter.py @@ -58,8 +58,9 @@ def __init__( """Netbooter constructor. ip_address: IP address of the netbooter port: the TCP port used for the telnet session.""" - super().__init__(ip_address, port, timeout, command_delay) + super().__init__(ip_address, timeout, command_delay) self.telnet = None + self.port = port def __str__(self): return f"{self.ip_address}:{self.port}" diff --git a/yinstruments/pdu/pdu.py b/yinstruments/pdu/pdu.py index c6c286b..768ad4a 100644 --- a/yinstruments/pdu/pdu.py +++ b/yinstruments/pdu/pdu.py @@ -13,19 +13,16 @@ class PDU: """Generic class for PDU""" DEFAULT_TIMEOUT_TIME = 3.0 # 3 seconds - DEFAULT_COMMAND_DELAY = ( - 1.0 # This is the original delay that may be needed by the Lindy. It is probably excessive - ) + DEFAULT_COMMAND_DELAY = 0.5 # initializes your PDU with callable characteristics @abstractmethod def __init__( - self, ip_address, port, timeout=DEFAULT_TIMEOUT_TIME, command_delay=DEFAULT_COMMAND_DELAY + self, ip_address, timeout=DEFAULT_TIMEOUT_TIME, command_delay=DEFAULT_COMMAND_DELAY ): self.sleep_time = command_delay self.timeout = timeout self.ip_address = ip_address - self.port = port @abstractmethod def __str__(self):