From f53e92ad0119aa2798303061e358624cce1e2367 Mon Sep 17 00:00:00 2001 From: Xavier Audier Date: Fri, 24 Mar 2023 16:22:17 -0400 Subject: [PATCH] fixes list_devices for filter_ids=Flase When filter_ids is False, the function was returning variable 'ids' (not defined in this case) as opposed to variable 'dids'. The proposed fix is functional under both conditions and has been tested using real hardware. --- pylablib/devices/Thorlabs/kinesis.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pylablib/devices/Thorlabs/kinesis.py b/pylablib/devices/Thorlabs/kinesis.py index 5574319..7d18075 100644 --- a/pylablib/devices/Thorlabs/kinesis.py +++ b/pylablib/devices/Thorlabs/kinesis.py @@ -100,8 +100,8 @@ def _is_thorlabs_id(did): return re.match(r"^\d{8}$",did[0]) is not None dids=comm_backend.FT232DeviceBackend.list_resources(desc=True) if filter_ids: - ids=[did for did in dids if _is_thorlabs_id(did)] - return ids + return [did for did in dids if _is_thorlabs_id(did)] + return dids def send_comm(self, messageID, param1=0x00, param2=0x00, source=0x01, dest="host"): """ Send a message with no associated data. @@ -1391,4 +1391,4 @@ def v2i(v, scale=10): open_loop_out=current_parameters.open_loop_out if open_loop_out is None else open_loop_out data=struct.pack("