From 6f63118b3bc9b50a3992f59e17ffffd9fd893a18 Mon Sep 17 00:00:00 2001 From: Dominic Canare Date: Thu, 8 Aug 2024 12:20:00 -0400 Subject: [PATCH] return calibration as dictionary and remove superfluous dimensions --- src/pupil_labs/realtime_api/device.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pupil_labs/realtime_api/device.py b/src/pupil_labs/realtime_api/device.py index e3a20a5..ede5c6d 100644 --- a/src/pupil_labs/realtime_api/device.py +++ b/src/pupil_labs/realtime_api/device.py @@ -277,7 +277,7 @@ async def get_calibration(self) -> np.ndarray: raise DeviceError(response.status, "Failed to fetch calibration") raw_data = await response.read() - return np.frombuffer( + data = np.frombuffer( raw_data, np.dtype( [ @@ -296,6 +296,7 @@ async def get_calibration(self) -> np.ndarray: ] ), ) + return {field: np.squeeze(data[field]) for field in data.dtype.names} class StatusUpdateNotifier: