diff --git a/README.rst b/README.rst index 8cd478e..f6d522b 100644 --- a/README.rst +++ b/README.rst @@ -82,6 +82,6 @@ See the `API Documentation`_ for more usage examples. :target: https://github.com/psf/black :alt: Style -.. |pylint| image:: https://mperlet.github.io/pybadge/badges/9.86.svg +.. |pylint| image:: https://mperlet.github.io/pybadge/badges/9.87.svg :target: https://github.com/mperlet/pybadge :alt: Vanilla Pylint Score diff --git a/py_hplc/__init__.py b/py_hplc/__init__.py index 8f980f7..070c8f8 100644 --- a/py_hplc/__init__.py +++ b/py_hplc/__init__.py @@ -1,4 +1,4 @@ """An unoffical Python wrapper for the SSI-Teledyne Next Generation class HPLC pumps.""" # make these available at package level -from py_hplc.pump_base import NextGenPumpBase from py_hplc.pump import NextGenPump +from py_hplc.pump_base import NextGenPumpBase diff --git a/py_hplc/pump.py b/py_hplc/pump.py index 757ef5a..f75e79b 100644 --- a/py_hplc/pump.py +++ b/py_hplc/pump.py @@ -298,7 +298,7 @@ def leak_detected(self) -> bool: def set_leak_mode(self, mode: int) -> int: """Sets the pump's current leak mode as an int. - + 0 if disabled. 1 if detected leak will fault. 2 if it will not fault. """ # there seems to not be a way to query the current value without setting it @@ -308,7 +308,7 @@ def set_leak_mode(self, mode: int) -> int: "or 2 (won't fault)." ) self.command(f"lm{mode}") # OK,LM:/ - + # properties for pumps with a solvent select feature ------------------------------ # todo solvent select commands need testing @property diff --git a/py_hplc/pump_base.py b/py_hplc/pump_base.py index 1e51d93..807cd9e 100644 --- a/py_hplc/pump_base.py +++ b/py_hplc/pump_base.py @@ -58,8 +58,8 @@ def open(self) -> None: """Opens the serial port associated with the pump. Raises: SerialException: An exception describing what went wrong. In this case, - we failed to open the serial port. - """ + we failed to open the serial port. + """ try: self.serial.open() self.logger.info("Serial port connected") @@ -134,7 +134,7 @@ def write(self, msg: str, delay: float = 0.015) -> str: A response will be returned after at least (2 * delay) seconds. Delay defaults to 0.015 s per pump documentation. - If we fail to get a "OK" response, we will wait 0.1 s before attempting again, + If we fail to get a "OK" response, we will wait 0.1 s before attempting again, up to 3 attempts. Returns the pump's response string. @@ -159,7 +159,7 @@ def write(self, msg: str, delay: float = 0.015) -> str: self.serial.reset_input_buffer() self.serial.reset_output_buffer() time.sleep(delay) # let the buffers clear (could defer here if async) - + # it seems getting pre-encoded strings from a dict is only slightly faster, # and only some of the time, when compared to just encoding args on the fly self.serial.write(msg.encode() + b"\r") @@ -167,7 +167,7 @@ def write(self, msg: str, delay: float = 0.015) -> str: self.serial.flush() # sleeps on a tight loop until everything is written if msg == "#": # this won't give a response break - + time.sleep(delay) # let the pump respond response = self.read() if "OK" not in response: # need to retry