From 05d7c4f1c7bdc1e3fa1c7d8c1bb07748cd807fa6 Mon Sep 17 00:00:00 2001 From: sdmurthy Date: Tue, 10 Feb 2026 21:18:36 -0800 Subject: [PATCH] raw.py: updates to get it compatible with numpy > 2.x test_cli.py: Fix flake8 issues --- leep/raw.py | 5 +++-- leep/test/test_cli.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/leep/raw.py b/leep/raw.py index d5c63ae..3dcc6d0 100644 --- a/leep/raw.py +++ b/leep/raw.py @@ -309,6 +309,7 @@ def wait_for_acq(self, tag=False, toggle_tag=False, timeout=5.0, if self.rfs: T, = self.reg_read(['dsp_tag'], instance=instance) + T = int(T) if tag or toggle_tag: T = (T + 1) & 0xff self.reg_write([('dsp_tag', T)], instance=instance) @@ -350,8 +351,8 @@ def wait_for_acq(self, tag=False, toggle_tag=False, timeout=5.0, if self.rfs: slow, = self.reg_read(['slow_data'], instance=instance) - tag_old = slow[34] - tag_new = slow[33] + tag_old = int(slow[34]) + tag_new = int(slow[33]) dT = (tag_old - T) & 0xff tag_match = dT == 0 and tag_new == tag_old diff --git a/leep/test/test_cli.py b/leep/test/test_cli.py index 74fe2f2..c998f79 100644 --- a/leep/test/test_cli.py +++ b/leep/test/test_cli.py @@ -293,12 +293,12 @@ def test_parseTransaction(): for _input in bads: try: result = parseTransaction(_input) - print(f"Expected an exception for input: { _input } but got {result}") + print(f"Expected an exception for input: {_input} but got {result}") errors += 1 except ValueError: pass except Exception as ex: - print(f"Unexpected exception for input: { _input }: { ex }") + print(f"Unexpected exception for input: {_input}: {ex}") errors += 1 return errors