Skip to content

Commit

Permalink
311 support shank orientation (#315)
Browse files Browse the repository at this point in the history
* Added ShankOrientation support

* Update setup-python

* Version bump

* CCW ShankOrientation

* Autoformat code

* Dependabot in workflows

---------

Co-authored-by: kjy5 <[email protected]>
  • Loading branch information
kjy5 and kjy5 authored Feb 5, 2024
1 parent 9841f15 commit 7d47997
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ updates:
schedule:
interval: "weekly"
- package-ecosystem: "github-actions" # See documentation for possible values
directory: ".github/" # Location of package manifests
directory: ".github/workflows" # Location of package manifests
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/autoformat-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
token: ${{ secrets.WORKFLOW_COMMIT }}

- name: 🐍 Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
Expand Down
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.2.2"
__version__ = "1.2.3"
8 changes: 2 additions & 6 deletions src/ephys_link/platforms/new_scale_pathfinder_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,15 @@ def _get_angles(self, manipulator_id: str) -> com.AngularOutputData:
[
adjusted_polar if adjusted_polar > 0 else 360 + adjusted_polar,
manipulator_data["Pitch"],
manipulator_data["Roll"],
(360 - manipulator_data.get("ShankOrientation", 0)) % 360,
],
"",
)

def _get_shank_count(self, manipulator_id: str) -> com.ShankCountOutputData:
for probe in self.query_data()["ProbeArray"]:
if probe["Id"] == manipulator_id:
if "ShankCount" in probe:
return com.ShankCountOutputData(probe["ShankCount"], "")

# Default to 1.0 if shank count is not found
return com.ShankCountOutputData(1, "")
return com.ShankCountOutputData(probe.get("ShankCount", 1), "")

return com.ShankCountOutputData(-1, "Unable to find manipulator")

Expand Down

0 comments on commit 7d47997

Please sign in to comment.