Skip to content

Commit

Permalink
Switch from list to Vector4 (#347)
Browse files Browse the repository at this point in the history
* Switch from list to Vector4

* Version bump to .0
  • Loading branch information
kjy5 authored May 9, 2024
1 parent f542389 commit e691c36
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/ephys_link/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.0b2"
__version__ = "1.3.0"
28 changes: 14 additions & 14 deletions src/ephys_link/platforms/ump3_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

0 comments on commit e691c36

Please sign in to comment.