From e691c36673793994da8e7684d8ef193c51df02d2 Mon Sep 17 00:00:00 2001 From: Kenneth Yang <82800265+kjy5@users.noreply.github.com> Date: Wed, 8 May 2024 17:08:08 -0700 Subject: [PATCH] Switch from list to Vector4 (#347) * Switch from list to Vector4 * Version bump to .0 --- src/ephys_link/__about__.py | 2 +- src/ephys_link/platforms/ump3_handler.py | 28 ++++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/ephys_link/__about__.py b/src/ephys_link/__about__.py index 42af590..67bc602 100644 --- a/src/ephys_link/__about__.py +++ b/src/ephys_link/__about__.py @@ -1 +1 @@ -__version__ = "1.3.0b2" +__version__ = "1.3.0" diff --git a/src/ephys_link/platforms/ump3_handler.py b/src/ephys_link/platforms/ump3_handler.py index 810619a..603ad8d 100644 --- a/src/ephys_link/platforms/ump3_handler.py +++ b/src/ephys_link/platforms/ump3_handler.py @@ -28,30 +28,30 @@ def _register_manipulator(self, manipulator_id: str) -> None: self.manipulators[manipulator_id] = UMP3Manipulator(self.ump.get_device(int(manipulator_id))) - def _platform_space_to_unified_space(self, platform_position: list[float]) -> list[float]: + def _platform_space_to_unified_space(self, platform_position: Vector4) -> Vector4: # unified <- platform # +x <- +y # +y <- -x # +z <- -z # +d <- +d/x - return [ - platform_position[1], - self.dimensions[0] - platform_position[0], - self.dimensions[2] - platform_position[2], - platform_position[3], - ] + return Vector4( + x=platform_position.y, + y=self.dimensions.x - platform_position.x, + z=self.dimensions.z - platform_position.z, + w=platform_position.w, + ) - def _unified_space_to_platform_space(self, unified_position: list[float]) -> list[float]: + def _unified_space_to_platform_space(self, unified_position: Vector4) -> Vector4: # platform <- unified # +x <- -y # +y <- +x # +z <- -z # +d/x <- +d - return [ - self.dimensions[1] - unified_position[1], - unified_position[0], - self.dimensions[2] - unified_position[2], - unified_position[3], - ] + return Vector4( + x=self.dimensions.y - unified_position.y, + y=unified_position.x, + z=self.dimensions.z - unified_position.z, + w=unified_position.w, + )