From cf02ef852735626fa9f563cab036deb2de19fe43 Mon Sep 17 00:00:00 2001 From: micah johnson Date: Sun, 6 Jul 2025 15:59:49 -0600 Subject: [PATCH 1/3] Removed matplotlib import --- radicl/interface.py | 1 - 1 file changed, 1 deletion(-) diff --git a/radicl/interface.py b/radicl/interface.py index 46c5e47..01fd817 100644 --- a/radicl/interface.py +++ b/radicl/interface.py @@ -6,7 +6,6 @@ from os.path import abspath, dirname, expanduser, isdir import pandas as pd -from matplotlib import pyplot as plt from termcolor import colored from study_lyte.io import write_csv From a84006c51a4dc2743881a3e735aa85324baa4f5f Mon Sep 17 00:00:00 2001 From: micah johnson Date: Sun, 6 Jul 2025 16:06:31 -0600 Subject: [PATCH 2/3] Fixed firmware bug on minor comparison --- radicl/info.py | 4 +++- tests/test_info.py | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/radicl/info.py b/radicl/info.py index e6f4989..a2e04c6 100644 --- a/radicl/info.py +++ b/radicl/info.py @@ -244,7 +244,9 @@ def __gt__(self, other): if v > ov: result = True break - + elif v < ov: + result = False + break return result def __repr__(self): diff --git a/tests/test_info.py b/tests/test_info.py index 9ff1ef8..9a13b97 100644 --- a/tests/test_info.py +++ b/tests/test_info.py @@ -58,7 +58,10 @@ def test_firmware_ge(self, fw1, fw2, expected): ('0.2', '0.2', False), ('0.0.0.2', '0.0.0.1', True), ('0.0.0.1', '0.0.0.2', False), - + ('1.45.2.1', '1.46.5', False), + ('1.46.2.1', '1.46.1.1', True), + ('1.46.2.1', '1.46.2.2', False), + ('1.46.2.1', '2', False), ]) def test_firmware_gt(self, fw1, fw2, expected): comparison = (fw1 > fw2) From ae1e4f4cd4d064343cb095a1c701a7b3794fe452 Mon Sep 17 00:00:00 2001 From: micah johnson Date: Sat, 19 Jul 2025 08:14:50 -0600 Subject: [PATCH 3/3] Added in none -> list -> None for scanning devices --- radicl/probe.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/radicl/probe.py b/radicl/probe.py index 368d792..b9fcc78 100644 --- a/radicl/probe.py +++ b/radicl/probe.py @@ -44,13 +44,13 @@ def __init__(self, ext_api: RAD_API=None, debug=False): self.debug = debug self.api:RAD_API = ext_api - self.available_devices = [] + self.available_devices = None self.log = get_logger(__name__, debug=self.debug) def update_devices(self): self.log.info("Scanning for COM ports...") - self._available_devices = find_kw_port(['STMicroelectronics', 'STM32']) + self.available_devices = find_kw_port(['STMicroelectronics', 'STM32']) @property def serial_number(self): @@ -60,11 +60,18 @@ def serial_number(self): @property def multiple_devices_available(self): - return len(self.available_devices) > 1 + result = False + if self.available_devices is not None: + result = len(self.available_devices) > 1 + return result @property def no_devices_available(self): - return len(self.available_devices) == 0 + """ Returns True if no devices are available, False otherwise""" + result = True + if self.available_devices is not None: + result = len(self.available_devices) == 0 + return result def connect(self, device=None): """ Attempt to establish a connection with the probe"""