Skip to content

Commit

Permalink
fix: allow empty returns from tsp_device.get_buffers()
Browse files Browse the repository at this point in the history
  • Loading branch information
ldantek committed Dec 19, 2024
1 parent 2b75108 commit 25bcb6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ However, please read through all changes to be aware of what may potentially imp
- A configuration function provides the ability to set different logging levels for stdout and file logging.
- The config file and environment variable can also be used to control the logging functionality.
- The debug logging from the `pyvisa` package is also included in the log file by default.
- Updated `get_buffers()` in `TSPControl` to not error out if query returns with empty string.

### Removed

Expand Down Expand Up @@ -97,6 +98,7 @@ However, please read through all changes to be aware of what may potentially imp

- `collectgarbage()` is now called during cleanup of `TSPControl` children.
- Added USBTMC Support for the AFG31K and MDO3 drivers.
-

---

Expand Down
4 changes: 3 additions & 1 deletion src/tm_devices/driver_mixins/device_control/tsp_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ def get_buffers(self, *args: str) -> Dict[str, List[float]]:
if buffer_name.endswith(attr_name):
buffer_size_name = buffer_name.rstrip(attr_name)
break
buffer_str = self.query(f"printbuffer(1, {buffer_size_name}.n, {buffer_name})")
buffer_str = self.query(
f"printbuffer(1, {buffer_size_name}.n, {buffer_name})", allow_empty=True
)
buffer_data[buffer_name] = [float(x) for x in buffer_str.split(", ") if buffer_str]
return buffer_data

Expand Down

0 comments on commit 25bcb6b

Please sign in to comment.