Skip to content

Commit

Permalink
Reformat, set pathfinder to -1
Browse files Browse the repository at this point in the history
  • Loading branch information
kjy5 committed Oct 10, 2023
1 parent fb8040a commit 5e7cbdb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/ephys_link/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,15 @@ class GetManipulatorsOutputData(dict):
:code:`{"manipulators": ["1", "2"], "error": ""}`
"""

def __init__(self, manipulators: list, num_axes: int, dimensions: list, error: str) -> None:
def __init__(
self, manipulators: list, num_axes: int, dimensions: list, error: str
) -> None:
"""Constructor"""
super(GetManipulatorsOutputData, self).__init__(
manipulators=manipulators, num_axes=num_axes, dimensions=dimensions, error=error
manipulators=manipulators,
num_axes=num_axes,
dimensions=dimensions,
error=error,
)


Expand Down
4 changes: 3 additions & 1 deletion src/ephys_link/platform_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def get_manipulators(self) -> com.GetManipulatorsOutputData:
except Exception as e:
print(f"[ERROR]\t\t Getting manipulators: {type(e)}: {e}\n")
finally:
return com.GetManipulatorsOutputData(devices, self.num_axes, self.dimensions, error)
return com.GetManipulatorsOutputData(
devices, self.num_axes, self.dimensions, error
)

def register_manipulator(self, manipulator_id: str) -> str:
"""Register a manipulator
Expand Down
8 changes: 6 additions & 2 deletions src/ephys_link/platforms/new_scale_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def _set_can_write(
)
return com.StateOutputData(can_write, "")

def _platform_space_to_unified_space(self, platform_position: list[float]) -> list[float]:
def _platform_space_to_unified_space(
self, platform_position: list[float]
) -> list[float]:
# unified <- platform
# +x <- -x
# +y <- +z
Expand All @@ -136,7 +138,9 @@ def _platform_space_to_unified_space(self, platform_position: list[float]) -> li
self.dimensions[3] - platform_position[3],
]

def _unified_space_to_platform_space(self, unified_position: list[float]) -> list[float]:
def _unified_space_to_platform_space(
self, unified_position: list[float]
) -> list[float]:
# platform <- unified
# +x <- -x
# +y <- +z
Expand Down
12 changes: 11 additions & 1 deletion src/ephys_link/platforms/new_scale_pathfinder_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, port: int = 8080) -> None:
"""
super().__init__()

self.type = "new_scale_pathfinder"
self.num_axes = -1

self.port = port

Expand Down Expand Up @@ -219,3 +219,13 @@ def _set_can_write(
sio: socketio.AsyncServer,
) -> com.StateOutputData:
pass

def _unified_space_to_platform_space(
self, unified_position: list[float]
) -> list[float]:
pass

def _platform_space_to_unified_space(
self, platform_position: list[float]
) -> list[float]:
pass

0 comments on commit 5e7cbdb

Please sign in to comment.