ephys-link 2.0.0b9__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/PKG-INFO +19 -21
  2. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/README.md +13 -12
  3. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/ephys_link.spec +8 -3
  4. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/mkdocs.yml +4 -4
  5. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/pyproject.toml +16 -17
  6. ephys_link-2.0.1/src/ephys_link/__about__.py +1 -0
  7. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/bindings/mpm_binding.py +2 -2
  8. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/bindings/ump_4_binding.py +1 -1
  9. ephys_link-2.0.0b9/docs/assets/favicon.ico +0 -0
  10. ephys_link-2.0.0b9/docs/assets/icon.png +0 -0
  11. ephys_link-2.0.0b9/docs/development/adding_a_manipulator.md +0 -77
  12. ephys_link-2.0.0b9/docs/development/code_organization.md +0 -41
  13. ephys_link-2.0.0b9/docs/development/index.md +0 -27
  14. ephys_link-2.0.0b9/docs/development/socketio_api.md +0 -418
  15. ephys_link-2.0.0b9/docs/home/citing.md +0 -9
  16. ephys_link-2.0.0b9/docs/home/contact.md +0 -10
  17. ephys_link-2.0.0b9/docs/home/how_it_works.md +0 -76
  18. ephys_link-2.0.0b9/docs/home/installation.md +0 -40
  19. ephys_link-2.0.0b9/docs/home/supported_manipulators.md +0 -12
  20. ephys_link-2.0.0b9/docs/index.md +0 -52
  21. ephys_link-2.0.0b9/docs/stylesheets/extra.css +0 -5
  22. ephys_link-2.0.0b9/docs/stylesheets/mkdocstrings.css +0 -42
  23. ephys_link-2.0.0b9/docs/usage/experiment_automation.md +0 -10
  24. ephys_link-2.0.0b9/docs/usage/starting_ephys_link.md +0 -62
  25. ephys_link-2.0.0b9/docs/usage/using_ephys_link.md +0 -31
  26. ephys_link-2.0.0b9/src/ephys_link/__about__.py +0 -1
  27. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/.gitignore +0 -0
  28. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/LICENSE +0 -0
  29. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/scripts/__init__.py +0 -0
  30. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/scripts/gen_ref_pages.py +0 -0
  31. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/scripts/logger_test.py +0 -0
  32. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/scripts/move_tester.py +0 -0
  33. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/scripts/server_tester.py +0 -0
  34. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/__init__.py +0 -0
  35. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/__main__.py +0 -0
  36. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/back_end/__init__.py +0 -0
  37. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/back_end/platform_handler.py +0 -0
  38. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/back_end/server.py +0 -0
  39. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/bindings/__init__.py +0 -0
  40. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/bindings/fake_binding.py +0 -0
  41. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/front_end/__init__.py +0 -0
  42. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/front_end/cli.py +0 -0
  43. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/front_end/gui.py +0 -0
  44. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/resources/libum.dll +0 -0
  45. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/utils/__init__.py +0 -0
  46. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/utils/base_binding.py +0 -0
  47. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/utils/console.py +0 -0
  48. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/utils/constants.py +0 -0
  49. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/utils/converters.py +0 -0
  50. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/src/ephys_link/utils/startup.py +0 -0
  51. {ephys_link-2.0.0b9 → ephys_link-2.0.1}/tests/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ephys-link
3
- Version: 2.0.0b9
3
+ Version: 2.0.1
4
4
  Summary: A Python Socket.IO server that allows any Socket.IO-compliant application to communicate with manipulators used in electrophysiology experiments.
5
5
  Project-URL: Documentation, https://virtualbrainlab.org/ephys_link/installation_and_use.html
6
6
  Project-URL: Issues, https://github.com/VirtualBrainLab/ephys-link/issues
@@ -17,34 +17,31 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
17
17
  Classifier: Operating System :: Microsoft :: Windows
18
18
  Classifier: Programming Language :: Python
19
19
  Classifier: Programming Language :: Python :: 3
20
- Classifier: Programming Language :: Python :: 3.10
21
- Classifier: Programming Language :: Python :: 3.11
22
- Classifier: Programming Language :: Python :: 3.12
23
20
  Classifier: Programming Language :: Python :: 3.13
24
21
  Classifier: Programming Language :: Python :: Implementation :: CPython
25
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
26
23
  Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
27
- Requires-Python: <3.14,>=3.10
28
- Requires-Dist: aiohttp==3.11.11
24
+ Requires-Python: >=3.13
25
+ Requires-Dist: aiohttp==3.11.16
29
26
  Requires-Dist: colorama==0.4.6
30
27
  Requires-Dist: keyboard==0.13.5
31
28
  Requires-Dist: packaging==24.2
32
- Requires-Dist: platformdirs==4.3.6
29
+ Requires-Dist: platformdirs==4.3.7
33
30
  Requires-Dist: pyserial==3.5
34
31
  Requires-Dist: python-socketio[asyncio-client]==5.12.1
35
32
  Requires-Dist: requests==2.32.3
36
- Requires-Dist: rich==13.9.4
33
+ Requires-Dist: rich==14.0.0
37
34
  Requires-Dist: sensapex==1.400.3
38
- Requires-Dist: vbl-aquarium==1.0.0b3
35
+ Requires-Dist: vbl-aquarium==1.0.0
39
36
  Description-Content-Type: text/markdown
40
37
 
41
38
  # Electrophysiology Manipulator Link
42
39
 
43
40
  [![PyPI version](https://badge.fury.io/py/ephys-link.svg)](https://badge.fury.io/py/ephys-link)
44
- [![Deploy Documentation](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/deploy-docs.yml)
45
- [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
46
41
  [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
42
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
47
43
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
44
+ [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
48
45
  [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
49
46
 
50
47
  <!-- [![Build](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/build.yml/badge.svg)](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/build.yml) -->
@@ -59,22 +56,23 @@ to communicate with manipulators used in electrophysiology experiments.
59
56
 
60
57
  # Installation
61
58
 
62
- ## Launch from Pinpoint (Recommended)
59
+ ## Pinpoint (Recommended)
63
60
 
64
61
  Pinpoint comes bundled with the correct version of Ephys Link. If you are using Pinpoint on the same computer your
65
- manipulators are connected to, you can launch the server from within Pinpoint. Follow the instructions in
66
- the [Pinpoint documentation](https://virtualbrainlab.org/pinpoint/tutorials/tutorial_ephys_link.html#configure-and-launch-ephys-link).
62
+ manipulators are connected to, you can launch the server from within Pinpoint. See the documentation
63
+ on [connecting from Pinpoint](../usage/using_ephys_link.md#connecting-to-pinpoint).
64
+
65
+ ## Install as a Standalone Executable
67
66
 
68
- ## Install as Standalone Executable
67
+ Download the latest standalone executable or zip from
68
+ the [releases page](https://github.com/VirtualBrainLab/ephys-link/releases/latest).
69
69
 
70
- 1. Download the latest standalone executable or zip from
71
- the [releases page](https://github.com/VirtualBrainLab/ephys-link/releases/latest).
72
- 2. Double-click the executable file to start.
70
+ Then see the [usage documentation](../usage/starting_ephys_link.md) for how to run the server.
73
71
 
74
72
  # Documentation and More Information
75
73
 
76
- Complete documentation including API usage and development installation can be
77
- found on the [Virtual Brain Lab Documentation page][docs] for Ephys Link.
74
+ Complete documentation including how to add manipulators and API usage can be
75
+ found on [Ephys Link's Documentation Website][docs].
78
76
 
79
77
  # Citing
80
78
 
@@ -88,4 +86,4 @@ through the issues tab.
88
86
 
89
87
  [Pinpoint]: https://github.com/VirtualBrainLab/Pinpoint
90
88
 
91
- [docs]: https://virtualbrainlab.github.io/ephys-link/
89
+ [docs]: https://ephys-link.virtualbrainlab.org
@@ -1,10 +1,10 @@
1
1
  # Electrophysiology Manipulator Link
2
2
 
3
3
  [![PyPI version](https://badge.fury.io/py/ephys-link.svg)](https://badge.fury.io/py/ephys-link)
4
- [![Deploy Documentation](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/deploy-docs.yml/badge.svg)](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/deploy-docs.yml)
5
- [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
6
4
  [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
5
+ [![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
7
6
  [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
7
+ [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/main/docs/badge/v2.json)](https://pydantic.dev)
8
8
  [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
9
9
 
10
10
  <!-- [![Build](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/build.yml/badge.svg)](https://github.com/VirtualBrainLab/ephys-link/actions/workflows/build.yml) -->
@@ -19,22 +19,23 @@ to communicate with manipulators used in electrophysiology experiments.
19
19
 
20
20
  # Installation
21
21
 
22
- ## Launch from Pinpoint (Recommended)
22
+ ## Pinpoint (Recommended)
23
23
 
24
24
  Pinpoint comes bundled with the correct version of Ephys Link. If you are using Pinpoint on the same computer your
25
- manipulators are connected to, you can launch the server from within Pinpoint. Follow the instructions in
26
- the [Pinpoint documentation](https://virtualbrainlab.org/pinpoint/tutorials/tutorial_ephys_link.html#configure-and-launch-ephys-link).
25
+ manipulators are connected to, you can launch the server from within Pinpoint. See the documentation
26
+ on [connecting from Pinpoint](../usage/using_ephys_link.md#connecting-to-pinpoint).
27
+
28
+ ## Install as a Standalone Executable
27
29
 
28
- ## Install as Standalone Executable
30
+ Download the latest standalone executable or zip from
31
+ the [releases page](https://github.com/VirtualBrainLab/ephys-link/releases/latest).
29
32
 
30
- 1. Download the latest standalone executable or zip from
31
- the [releases page](https://github.com/VirtualBrainLab/ephys-link/releases/latest).
32
- 2. Double-click the executable file to start.
33
+ Then see the [usage documentation](../usage/starting_ephys_link.md) for how to run the server.
33
34
 
34
35
  # Documentation and More Information
35
36
 
36
- Complete documentation including API usage and development installation can be
37
- found on the [Virtual Brain Lab Documentation page][docs] for Ephys Link.
37
+ Complete documentation including how to add manipulators and API usage can be
38
+ found on [Ephys Link's Documentation Website][docs].
38
39
 
39
40
  # Citing
40
41
 
@@ -48,4 +49,4 @@ through the issues tab.
48
49
 
49
50
  [Pinpoint]: https://github.com/VirtualBrainLab/Pinpoint
50
51
 
51
- [docs]: https://virtualbrainlab.github.io/ephys-link/
52
+ [docs]: https://ephys-link.virtualbrainlab.org
@@ -1,22 +1,27 @@
1
1
  # -*- mode: python ; coding: utf-8 -*-
2
2
 
3
- from ephys_link.__about__ import __version__ as version
4
-
5
3
  from argparse import ArgumentParser
6
4
 
5
+ from PyInstaller.utils.hooks import collect_submodules
6
+
7
+ from ephys_link.__about__ import __version__ as version
8
+
7
9
  parser = ArgumentParser()
8
10
  parser.add_argument("-d", "--dir", action="store_true", help="Outputs a directory")
9
11
  options = parser.parse_args()
10
12
 
11
13
  FILE_NAME = f"EphysLink-v{version}"
12
14
 
15
+ # Collect binding modules.
16
+ bindings = [binding for binding in collect_submodules("ephys_link.bindings") if binding != "ephys_link.bindings"]
17
+
13
18
  # noinspection PyUnresolvedReferences
14
19
  a = Analysis(
15
20
  ['src\\ephys_link\\__main__.py'],
16
21
  pathex=[],
17
22
  binaries=[('src\\ephys_link\\resources', 'ephys_link\\resources')],
18
23
  datas=[],
19
- hiddenimports=['engineio.async_drivers.aiohttp'],
24
+ hiddenimports=['engineio.async_drivers.aiohttp'] + bindings,
20
25
  hookspath=[],
21
26
  hooksconfig={},
22
27
  runtime_hooks=[],
@@ -1,9 +1,9 @@
1
1
  # yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json
2
2
 
3
3
  site_name: Ephys Link
4
- site_url: https://virtualbrainlab.github.io/ephys-link
4
+ site_url: https://ephys-link.virtualbrainlab.org
5
5
  repo_url: https://github.com/VirtualBrainLab/ephys-link
6
- repo_name: virtualbrainlab/ephys-link
6
+ repo_name: VirtualBrainLab/ephys-link
7
7
  copyright: Copyright &copy; 2024 Virtual Brain Lab
8
8
  extra:
9
9
  social:
@@ -86,9 +86,9 @@ plugins:
86
86
  docstring_style: google
87
87
  show_symbol_type_heading: true
88
88
  show_symbol_type_toc: true
89
- import:
89
+ inventories:
90
90
  - https://docs.python.org/3/objects.inv
91
- - https://virtualbrainlab.github.io/vbl-aquarium/objects.inv
91
+ - https://aquarium.virtualbrainlab.org/objects.inv
92
92
  nav:
93
93
  - Home:
94
94
  - About: index.md
@@ -7,16 +7,13 @@ name = "ephys-link"
7
7
  dynamic = ["version"]
8
8
  description = "A Python Socket.IO server that allows any Socket.IO-compliant application to communicate with manipulators used in electrophysiology experiments."
9
9
  readme = "README.md"
10
- requires-python = ">=3.10, <3.14"
10
+ requires-python = ">=3.13"
11
11
  license = "GPL-3.0-only"
12
12
  keywords = ["socket-io", "manipulator", "electrophysiology", "ephys", "sensapex", "neuroscience", "neurotech", "virtualbrainlab", "new-scale"]
13
13
  authors = [{ name = "Kenneth Yang", email = "kjy5@uw.edu" }]
14
14
  maintainers = [{ name = "Kenneth Yang", email = "kjy5@uw.edu" }]
15
15
  classifiers = [
16
16
  "Programming Language :: Python",
17
- "Programming Language :: Python :: 3.10",
18
- "Programming Language :: Python :: 3.11",
19
- "Programming Language :: Python :: 3.12",
20
17
  "Programming Language :: Python :: 3.13",
21
18
  "Programming Language :: Python :: Implementation :: CPython",
22
19
  "Programming Language :: Python :: Implementation :: PyPy",
@@ -29,17 +26,17 @@ classifiers = [
29
26
  "Topic :: Scientific/Engineering :: Medical Science Apps.",
30
27
  ]
31
28
  dependencies = [
32
- "aiohttp==3.11.11",
29
+ "aiohttp==3.11.16",
33
30
  "colorama==0.4.6",
34
31
  "keyboard==0.13.5",
35
32
  "packaging==24.2",
36
- "platformdirs==4.3.6",
33
+ "platformdirs==4.3.7",
37
34
  "pyserial==3.5",
38
35
  "python-socketio[asyncio_client]==5.12.1",
39
36
  "requests==2.32.3",
40
37
  "sensapex==1.400.3",
41
- "rich==13.9.4",
42
- "vbl-aquarium==1.0.0b3"
38
+ "rich==14.0.0",
39
+ "vbl-aquarium==1.0.0"
43
40
  ]
44
41
 
45
42
  [project.urls]
@@ -56,13 +53,14 @@ el = "ephys_link.__main__:main"
56
53
  path = "src/ephys_link/__about__.py"
57
54
 
58
55
  [tool.hatch.build.targets.sdist]
59
- exclude = ["/.github", "/.idea"]
56
+ exclude = ["/.github", "/.idea", "/docs"]
60
57
 
61
58
  [tool.hatch.envs.default]
62
- python = "3.13.1"
59
+ installer = "uv"
60
+ python = "3.13"
63
61
  dependencies = [
64
- "pyinstaller==6.11.1",
65
- "basedpyright==1.23.1",
62
+ "pyinstaller==6.12.0",
63
+ "basedpyright==1.28.5",
66
64
  ]
67
65
  [tool.hatch.envs.default.scripts]
68
66
  exe = "pyinstaller.exe ephys_link.spec -y -- -d && pyinstaller.exe ephys_link.spec -y"
@@ -71,14 +69,15 @@ check = "basedpyright"
71
69
  check-watched = "basedpyright --watch"
72
70
 
73
71
  [tool.hatch.envs.docs]
74
- python = "3.13.1"
72
+ installer = "uv"
73
+ python = "3.13"
75
74
  skip-install = true
76
75
  dependencies = [
77
- "mkdocs-material==9.5.49",
78
- "mkdocstrings-python==1.13.0",
76
+ "mkdocs-material==9.6.11",
77
+ "mkdocstrings-python==1.16.10",
79
78
  "mkdocs-gen-files==0.5.0",
80
- "mkdocs-literate-nav==0.6.1",
81
- "mkdocs-section-index==0.3.9"
79
+ "mkdocs-literate-nav==0.6.2",
80
+ "mkdocs-section-index==0.3.10"
82
81
  ]
83
82
  [tool.hatch.envs.docs.scripts]
84
83
  serve = "mkdocs serve"
@@ -0,0 +1 @@
1
+ __version__ = "2.0.1"
@@ -127,7 +127,7 @@ class MPMBinding(BaseBinding):
127
127
  manipulator_data: dict[str, float] = await self._manipulator_data(manipulator_id)
128
128
 
129
129
  # Apply PosteriorAngle to Polar to get the correct angle.
130
- adjusted_polar: int = manipulator_data["Polar"] - (await self._query_data())["PosteriorAngle"]
130
+ adjusted_polar: int = manipulator_data["Polar"] - (await self._query_data())["PosteriorAngle"] # pyright: ignore [reportAny]
131
131
 
132
132
  return Vector3(
133
133
  x=adjusted_polar if adjusted_polar > 0 else 360 + adjusted_polar,
@@ -299,7 +299,7 @@ class MPMBinding(BaseBinding):
299
299
  return self.cache
300
300
 
301
301
  async def _manipulator_data(self, manipulator_id: str) -> dict[str, Any]: # pyright: ignore [reportExplicitAny]
302
- probe_data: list[dict[str, Any]] = (await self._query_data())["ProbeArray"] # pyright: ignore [reportExplicitAny]
302
+ probe_data: list[dict[str, Any]] = (await self._query_data())["ProbeArray"] # pyright: ignore [reportExplicitAny, reportAny]
303
303
  for probe in probe_data:
304
304
  if probe["Id"] == manipulator_id:
305
305
  return probe
@@ -100,7 +100,7 @@ class Ump4Binding(BaseBinding):
100
100
  raise RuntimeError(error_message)
101
101
 
102
102
  # Handle empty end position.
103
- if not movement.last_pos: # pyright: ignore [reportUnknownMemberType]
103
+ if movement.last_pos is None or len(movement.last_pos) == 0: # pyright: ignore [reportUnknownMemberType, reportUnknownArgumentType]
104
104
  error_message = f"Manipulator {manipulator_id} did not reach target position"
105
105
  raise RuntimeError(error_message)
106
106
 
Binary file
Binary file
@@ -1,77 +0,0 @@
1
- # Adding a Manipulator
2
-
3
- By the end of this section, you will be able to add a manipulator platform to Ephys Link and control it using the server
4
- API. This is a software development guide and assumes you have experience with Python. It is encouraged to
5
- read [how the system works first](../home/how_it_works.md) before proceeding.
6
-
7
- ## Set Up for Development
8
-
9
- 1. Fork the [Ephys Link repository](https://github.com/VirtualBrainLab/ephys-link).
10
- 2. Follow the instructions for [installing Ephys Link for development](index.md#installing-for-development) to get all
11
- the necessary dependencies and tools set up. In this case, you'll want to clone your fork.
12
- 3. (Optional) Familiarize yourself with the [repo's organization](code_organization.md).
13
-
14
- ## Create a Manipulator Binding
15
-
16
- Manipulators are added to Ephys Link through bindings. A binding is a Python class that extends the abstract base class
17
- [`BaseBinding`][ephys_link.utils.base_binding] and defines the methods Ephys Link expects from a platform.
18
-
19
- Create a new Python module in `src/ephys_link/bindings` for your manipulator. Make a class that extends
20
- [`BaseBinding`][ephys_link.utils.base_binding]. Most IDEs will automatically import the necessary classes and tell you
21
- the methods you need to implement. See the reference for [`BaseBinding`][ephys_link.utils.base_binding] for detailed
22
- descriptions of the expected behavior.
23
-
24
- As described in the [system overview](../home/how_it_works.md), Ephys Link converts all manipulator movement into a
25
- common "unified space" which is
26
- the [left-hand cartesian coordinate system](https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/geometry/coordinate-systems.html).
27
- The two methods [
28
- `platform_space_to_unified_space`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.platform_space_to_unified_space)
29
- and [
30
- `unified_space_to_platform_space`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.unified_space_to_platform_space)
31
- are used to convert between your manipulator's coordinate system and the unified space.
32
-
33
- !!! tip
34
-
35
- See
36
- the [Sensapex uMp-4](https://github.com/VirtualBrainLab/ephys-link/blob/main/src/ephys_link/bindings/ump_4_bindings.py)
37
- binding for an example where the platform has a Python API (Sensapex's SDK) and
38
- the [New Scale Pathfinder MPM](https://github.com/VirtualBrainLab/ephys-link/blob/main/src/ephys_link/bindings/mpm_bindings.py)
39
- binding, for example, where the platform uses a REST API for an external provider.
40
-
41
- ### Binding Names
42
-
43
- The two naming methods [
44
- `get_display_name`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.get_display_name)
45
- and [
46
- `get_cli_name`](../../reference/ephys_link/utils/base_binding/#ephys_link.utils.base_binding.BaseBinding.get_cli_name)
47
- are used to identify the binding in the user interface. As described by their documentation, `get_display_name` should
48
- return a human-readable name for the binding, while `get_cli_name` should return the name used to launch the binding
49
- from the command line (what is passed to the `-t` flag). For example, Sensapex uMp-4 manipulator's `get_cli_name`
50
- returns `ump-4` because the CLI launch command is `ephys_link.exe -b -t ump-4`.
51
-
52
- ### Custom Additional Arguments
53
-
54
- Sometimes you may want to pass extra data to your binding on initialization. For example, New Scale Pathfinder MPM
55
- bindings need to know what the HTTP server port is. To add custom arguments, define them as arguments on the `__init__`
56
- method of your binding then pass in the appropriate data when the binding is instantiated in the [
57
- `_get_binding_instance`](https://github.com/VirtualBrainLab/ephys-link/blob/f79c1ec68ec1805e1a4e231e1934127893f7bd20/src/ephys_link/back_end/platform_handler.py#L58)
58
- method of the [`PlatformHandler`][ephys_link.back_end.platform_handler].
59
- Use [New Scale Pathfinder MPM's binding][ephys_link.bindings.mpm_binding] as an example of how to do this.
60
-
61
- ## Test Your Binding
62
-
63
- Once you've implemented your binding, you can test it by running Ephys Link using your binding
64
- `ephys_link -b -t <cli_name>`. You can interact with it using the [Socket.IO API](socketio_api.md) or Pinpoint.
65
-
66
- ## Code standards
67
-
68
- We use automatic static analyzers to check code quality. See
69
- the [corresponding section in the code organization documentation](code_organization.md#static-analysis) for more
70
- information.
71
-
72
- ## Submit Your Changes
73
-
74
- When satisfied with your changes, submit a pull request to the main repository. We will review your changes and
75
- merge them if they meet our standards!
76
-
77
- Feel free to [reach out](../home/contact.md) to us if you have any questions or need help with your binding!
@@ -1,41 +0,0 @@
1
- # Code Organization
2
-
3
- This section gives an overview of Ephys Link's internal architecture. It is intended for
4
- maintainers of Ephys Link.
5
-
6
- ## File Structure
7
-
8
- Ephys Link starts from the `__main__.py` file. It imports each component of the application and calls the launch
9
- sequence.
10
-
11
- ### Where to find things
12
-
13
- - `back_end`: the Socket.IO server and the manipulator API.
14
- - `front_end`: configuration GUI and CLI definition.
15
- - `bindings`: manipulator binding implementations.
16
- - `utils`: common utilities and helper functions (including
17
- [the base binding abstract base class][ephys_link.utils.base_binding]).
18
-
19
- ## Control Flow
20
-
21
- As described in ["How It Works"](../home/how_it_works.md), Ephys Link is primarily a server that responds to events. The
22
- server exposes the events and passes them to the chosen manipulator binding. Everything is asynchronous and uses callbacks
23
- to return responses to the clients when ready.
24
-
25
- [`PlatformHandler`][ephys_link.back_end.platform_handler] is responsible for converting between the server API and the
26
- manipulator binding API. Because of this module, you don't have to worry about the details of the server API when
27
- writing a manipulator binding.
28
-
29
- ## Static Analysis
30
-
31
- The project is strictly type-checked using [`hatch fmt` (ruff)](https://hatch.pypa.io/1.9/config/static-analysis/)
32
- and [basedpyright](https://docs.basedpyright.com/latest/). All PRs are checked against these tools.
33
-
34
- While they are invaluable in enforcing good code, they can be annoying when working with libraries that inherently
35
- return `Any` (like HTTP requests) or are not strictly statically typed. In those situations, we have added inline
36
- comments to ignore specific checks. We try to only use this in scenarios where missing typing information comes from
37
- external sources, and it is not possible to make local type hints. Do not use file-wide ignores under any circumstances.
38
- We also do not make stubs since they would be challenging to maintain.
39
-
40
- We encourage using the type checker as a tool to help strengthen your code and only apply inline comments to ignore
41
- specific instances where external libraries cause errors.
@@ -1,27 +0,0 @@
1
- # Developing with Ephys Link
2
-
3
- Ephys Link is free and open-source software. All of our code is available
4
- on [GitHub](https://github.com/VirtualBrainLab/ephys-link), and we welcome contributions from the community!
5
-
6
- This section describes:
7
-
8
- - [The Socket.IO server's API](socketio_api.md) and how to communicate with Ephys Link from a client application
9
- - How to [add a new manipulator](adding_a_manipulator.md) to Ephys Link
10
- - General [code organization](code_organization.md) for Ephys Link
11
- - Auto-generated [source code reference](../reference/SUMMARY.md) intended for developers who are maintaining Ephys Link
12
-
13
- ## Installing for Development
14
-
15
- 1. Clone the repository.
16
- 2. Install [Hatch](https://hatch.pypa.io/latest/install/)
17
- 3. In a terminal, navigate to the repository's root directory and run
18
-
19
- ```bash
20
- hatch shell
21
- ```
22
-
23
- This will create a virtual environment, install Python 13 (if not found), and install the package in editable mode.
24
-
25
- If you encounter any dependency issues (particularly with `aiohttp`), try installing the latest Microsoft Visual C++
26
- (MSVC v143+ x86/64) and the Windows SDK (10/11)
27
- via [Visual Studio Build Tools Installer](https://visualstudio.microsoft.com/visual-cpp-build-tools/).