etho-python 0.23.0__tar.gz → 1.0__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.
- etho_python-1.0/CITATION.cff +26 -0
- etho_python-1.0/CONTRIBUTING.md +29 -0
- etho_python-1.0/PKG-INFO +121 -0
- etho_python-1.0/README.md +71 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/callbacks.md +1 -26
- {etho_python-0.23.0 → etho_python-1.0}/docs/conf.py +16 -6
- etho_python-1.0/docs/extensions.md +188 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/hardware/hardware.rst +3 -0
- etho_python-1.0/docs/index.rst +68 -0
- etho_python-1.0/docs/install.rst +83 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/logging.md +7 -18
- {etho_python-0.23.0 → etho_python-1.0}/docs/make_api_doctree.py +1 -2
- {etho_python-0.23.0 → etho_python-1.0}/docs/tutorial.md +23 -35
- {etho_python-0.23.0 → etho_python-1.0}/pyproject.toml +11 -5
- etho_python-1.0/src/etho/client.py +254 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/BLTZeroService.py +45 -19
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/DAQZeroService.py +104 -20
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/DLPZeroService.py +46 -19
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/GCMZeroService.py +53 -16
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/GOVZeroService.py +29 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/NICounterZeroService.py +59 -23
- etho_python-0.23.0/src/etho/services/NITriggerZeroService.py → etho_python-1.0/src/etho/services/ScanImageTriggerZeroService.py +55 -26
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/TemplateZeroService.py +46 -20
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/ZeroService.py +11 -6
- etho_python-1.0/src/etho/services/__init__.py +52 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/callbacks/_trace.py +3 -98
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/dlp/dlp_runners.py +3 -15
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/utils/sound.py +2 -2
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_gov_service.py +11 -87
- etho_python-1.0/tests/test_service_client_wiring.py +92 -0
- etho_python-0.23.0/CONTRIBUTING.md +0 -2
- etho_python-0.23.0/PKG-INFO +0 -229
- etho_python-0.23.0/README.md +0 -181
- etho_python-0.23.0/docs/index.rst +0 -27
- etho_python-0.23.0/docs/install.md +0 -93
- etho_python-0.23.0/docs/quickstart.md +0 -93
- etho_python-0.23.0/src/etho/client.py +0 -384
- etho_python-0.23.0/src/etho/services/ANAZeroService.py +0 -123
- etho_python-0.23.0/src/etho/utils/__init__.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/.github/workflows/python-package.yml +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/.github/workflows/static.yml +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/.gitignore +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/Makefile +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/README.md +0 -0
- /etho_python-0.23.0/docs/_static/etho_icon1_pipeline_dark.svg → /etho_python-1.0/docs/_static/etho_dark.svg +0 -0
- /etho_python-0.23.0/docs/_static/etho_icon1_pipeline_light.svg → /etho_python-1.0/docs/_static/etho_light.svg +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/_templates/api_head.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/_templates/autosummary/module.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.app.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.cli.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.client.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.BLTZeroService.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.DAQZeroService.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.GCMZeroService.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.GOVZeroService.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.NICounterZeroService.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.TemplateZeroService.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.ZeroService.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.camera.base.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.camera.basler.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.camera.dummy.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.camera.hamamatsu.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.camera.spinnaker.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.camera.ximea.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.dlp.dlp_make_warpfiles.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.utils.concurrent_task.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.services.utils.log_exceptions.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.utils.calibration.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.utils.config.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.utils.runner.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.utils.shuffled_cycle.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.utils.sound.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.utils.tui.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api/etho.utils.zeroclient.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/api_etho.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/cli.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/configuration/calibration_led.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/configuration/calibration_speaker.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/configuration/configuration.rst +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/configuration/global.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/configuration/playlist.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/configuration/protocol.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/hardware/camera.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/hardware/nidaq.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/hardware/projector.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/hardware/scanimage.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/docs/make.bat +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/paper/paper.md +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/__init__.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/app.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/assets/etho_icon1_pipeline_dark.svg +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/assets/etho_icon1_pipeline_light.svg +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/cli.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/callbacks/__init__.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/callbacks/_base.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/callbacks/_image.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/camera/__init__.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/camera/base.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/camera/basler.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/camera/dummy.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/camera/hamamatsu.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/camera/spinnaker.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/camera/ximea.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/daq/IOTask.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/daq/ai.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/dlp/dlp_make_warpfiles.py +0 -0
- {etho_python-0.23.0/src/etho/services → etho_python-1.0/src/etho/services/utils}/__init__.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/utils/concurrent_task.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/services/utils/log_exceptions.py +0 -0
- {etho_python-0.23.0/src/etho/services → etho_python-1.0/src/etho}/utils/__init__.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/utils/calibration.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/utils/config.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/utils/runner.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/utils/shuffled_cycle.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/utils/tui.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/src/etho/utils/zeroclient.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_config.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_config.yaml +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_import.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_services.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_shuffled_cycle.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_sound.py +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_sound_playlist_mirrorled.txt +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_sound_playlist_mono.txt +0 -0
- {etho_python-0.23.0 → etho_python-1.0}/tests/test_sound_playlist_stereo.txt +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If you use etho in your research, please cite the software using the metadata below."
|
|
3
|
+
title: "etho"
|
|
4
|
+
abstract: "A Python framework for coordinating stimuli, data acquisition, and hardware control in neuroscience experiments."
|
|
5
|
+
type: software
|
|
6
|
+
|
|
7
|
+
authors:
|
|
8
|
+
- family-names: Clemens
|
|
9
|
+
given-names: Jan
|
|
10
|
+
orcid: "https://orcid.org/0000-0003-4200-8097"
|
|
11
|
+
affiliation: "Carl von Ossietzky University, Oldenburg, Germany"
|
|
12
|
+
|
|
13
|
+
repository-code: "https://github.com/janclemenslab/etho"
|
|
14
|
+
license: MIT
|
|
15
|
+
|
|
16
|
+
preferred-citation:
|
|
17
|
+
type: article
|
|
18
|
+
title: "etho: A Python framework for coordinating stimuli, data acquisition, and hardware control in neuroscience experiments"
|
|
19
|
+
authors:
|
|
20
|
+
- family-names: Clemens
|
|
21
|
+
given-names: Jan
|
|
22
|
+
orcid: "https://orcid.org/0000-0003-4200-8097"
|
|
23
|
+
affiliation: "Carl von Ossietzky University, Oldenburg, Germany"
|
|
24
|
+
journal: "tbd"
|
|
25
|
+
year: 2026
|
|
26
|
+
date-released: 2026-05-10
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to `etho`.
|
|
4
|
+
|
|
5
|
+
## Reporting issues
|
|
6
|
+
|
|
7
|
+
Please use the GitHub issue tracker to report bugs, request features, or ask questions. When possible, include:
|
|
8
|
+
|
|
9
|
+
- a minimal reproducible example
|
|
10
|
+
- operating system and Python version
|
|
11
|
+
- output of `etho version`
|
|
12
|
+
- relevant log output or error messages
|
|
13
|
+
|
|
14
|
+
## Development setup
|
|
15
|
+
|
|
16
|
+
Clone the repository and install the package in editable mode:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
|
|
20
|
+
git clone https://github.com/janclemenslab/etho.git
|
|
21
|
+
|
|
22
|
+
cd etho
|
|
23
|
+
|
|
24
|
+
pip install -e ".[dev]"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Running tests
|
|
28
|
+
|
|
29
|
+
Run the test suite locally before submitting changes with `pytest`. Continuous integration (CI) tests are automatically run on all pull requests and must pass before merging.
|
etho_python-1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: etho-python
|
|
3
|
+
Version: 1.0
|
|
4
|
+
Summary: etho
|
|
5
|
+
Author-email: Jan Clemens <clemensjan@googlemail.com>
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Requires-Dist: numpy
|
|
10
|
+
Requires-Dist: scipy
|
|
11
|
+
Requires-Dist: h5py
|
|
12
|
+
Requires-Dist: opencv-python-headless
|
|
13
|
+
Requires-Dist: bleak
|
|
14
|
+
Requires-Dist: pandas
|
|
15
|
+
Requires-Dist: pyzmq
|
|
16
|
+
Requires-Dist: gevent
|
|
17
|
+
Requires-Dist: future
|
|
18
|
+
Requires-Dist: pillow
|
|
19
|
+
Requires-Dist: msgpack-python
|
|
20
|
+
Requires-Dist: pyyaml
|
|
21
|
+
Requires-Dist: ipython
|
|
22
|
+
Requires-Dist: defopt
|
|
23
|
+
Requires-Dist: msgpack-numpy
|
|
24
|
+
Requires-Dist: rich
|
|
25
|
+
Requires-Dist: psutil
|
|
26
|
+
Requires-Dist: tables
|
|
27
|
+
Requires-Dist: pydaqmx
|
|
28
|
+
Requires-Dist: pyqtgraph
|
|
29
|
+
Requires-Dist: qtpy
|
|
30
|
+
Requires-Dist: PySide6-Essentials
|
|
31
|
+
Requires-Dist: zarr
|
|
32
|
+
Requires-Dist: zerorpc-numpy
|
|
33
|
+
Requires-Dist: pytest ; extra == "dev"
|
|
34
|
+
Requires-Dist: flit>=3.2,<4 ; extra == "dev"
|
|
35
|
+
Requires-Dist: sphinx ; extra == "doc"
|
|
36
|
+
Requires-Dist: furo ; extra == "doc"
|
|
37
|
+
Requires-Dist: shibuya ; extra == "doc"
|
|
38
|
+
Requires-Dist: sphinx-copybutton ; extra == "doc"
|
|
39
|
+
Requires-Dist: ghp-import ; extra == "doc"
|
|
40
|
+
Requires-Dist: myst-nb ; extra == "doc"
|
|
41
|
+
Requires-Dist: sphinx-panels ; extra == "doc"
|
|
42
|
+
Requires-Dist: sphinxcontrib-images ; extra == "doc"
|
|
43
|
+
Requires-Dist: sphinx-tabs ; extra == "doc"
|
|
44
|
+
Requires-Dist: sphinx-iconify ; extra == "doc"
|
|
45
|
+
Requires-Dist: sphinx-design ; extra == "doc"
|
|
46
|
+
Project-URL: documentation, https://janclemenslab.org/etho/
|
|
47
|
+
Project-URL: source, https://github.com/janclemenslab/etho
|
|
48
|
+
Provides-Extra: dev
|
|
49
|
+
Provides-Extra: doc
|
|
50
|
+
|
|
51
|
+
# `etho`: A Python framework for coordinating stimuli, data acquisition, and hardware control in neuroscience experiments
|
|
52
|
+
|
|
53
|
+
[](https://github.com/janclemenslab/etho/actions/workflows/python-package.yml)
|
|
54
|
+
[](https://janclemenslab.org/etho)
|
|
55
|
+
[](LICENSE)
|
|
56
|
+
[](https://doi.org/10.5281/zenodo.20110619)
|
|
57
|
+
|
|
58
|
+
`etho` is an open-source Python framework for running behavioral neuroscience experiments that require coordinated stimulus presentation, hardware control, data acquisition, and experiment logging.
|
|
59
|
+
|
|
60
|
+
It was developed for neuroscience experiments, where multiple hardware devices must operate together with reproducible timing. `etho` coordinates cameras, National Instruments DAQ hardware, acoustic and optogenetic stimulation, environmental sensors, and external imaging systems through a modular service-based architecture.
|
|
61
|
+
|
|
62
|
+
The software is designed to make experiments reproducible, configurable, and maintainable by separating:
|
|
63
|
+
- experiment logic and hardware (`protocol.yaml`)
|
|
64
|
+
- stimulus definitions (`playlist.txt`)
|
|
65
|
+
- acquisition callbacks and logs
|
|
66
|
+
|
|
67
|
+
from the underlying device code.
|
|
68
|
+
|
|
69
|
+
See the [documentation](https://janclemenslab.org/etho) for details.
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## Installation
|
|
73
|
+
|
|
74
|
+
Quick installation:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uv venv --python 3.14
|
|
78
|
+
.venv\Scripts\activate
|
|
79
|
+
uv pip install etho-python
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Some hardware backends require additional vendor SDKs and drivers and specific python versions.
|
|
83
|
+
See the full [installation guide](https://janclemenslab.org/etho/install.html).
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## Usage
|
|
87
|
+
|
|
88
|
+
Etho can be controlled via a GUI. Launch it with:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
etho gui
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Alternatively, experiments can be run from the terminal:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
etho run protocol.yaml
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Data generated by etho can be inspected, annotated, and analyzed with [xarray-behave](https://github.com/janclemenslab/xarray-behave).
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
## Citation
|
|
104
|
+
|
|
105
|
+
If you use `etho`earch, please cite:
|
|
106
|
+
|
|
107
|
+
```bibtex
|
|
108
|
+
TODO
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
A [JOSS paper](paper/paper.md) describing the software is in preparation.
|
|
112
|
+
|
|
113
|
+
The `etho` software has been used in the following publications:
|
|
114
|
+
|
|
115
|
+
- Vijendravarma, R. K., Narasimha, S., Steinfath, E., Clemens, J., & Leopold, P. (2022). *Drosophila* females have an acoustic preference for symmetric males. Proceedings of the National Academy of Sciences, 119(13), e2116136119. https://doi.org/10.1073/pnas.2116136119
|
|
116
|
+
|
|
117
|
+
- Steinfath, E., Khalili, A., Stenger, M., Schultze, B. L., Nair, S. R., Alizadeh, K., & Clemens, J. (2025). A neural circuit for context-dependent multimodal signaling in *Drosophila*. Nature Communications, 16, 9472. https://doi.org/10.1038/s41467-025-64907-9
|
|
118
|
+
|
|
119
|
+
- Palacios-Muñoz, A., & Clemens, J. (2025). *Drosophila* males integrate song and pheromones using context-specific strategies. bioRxiv. https://doi.org/10.1101/2025.07.25.666755
|
|
120
|
+
|
|
121
|
+
- Ravindran Nair, S., Palacios-Muñoz, A., Martineau, S., Nasr, M., & Clemens, J. (2026). Sex-specific behavioral feedback modulates sensorimotor processing and drives flexible social behavior. Nature Communications, 17, 4026. https://doi.org/10.1038/s41467-026-72057-9
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# `etho`: A Python framework for coordinating stimuli, data acquisition, and hardware control in neuroscience experiments
|
|
2
|
+
|
|
3
|
+
[](https://github.com/janclemenslab/etho/actions/workflows/python-package.yml)
|
|
4
|
+
[](https://janclemenslab.org/etho)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://doi.org/10.5281/zenodo.20110619)
|
|
7
|
+
|
|
8
|
+
`etho` is an open-source Python framework for running behavioral neuroscience experiments that require coordinated stimulus presentation, hardware control, data acquisition, and experiment logging.
|
|
9
|
+
|
|
10
|
+
It was developed for neuroscience experiments, where multiple hardware devices must operate together with reproducible timing. `etho` coordinates cameras, National Instruments DAQ hardware, acoustic and optogenetic stimulation, environmental sensors, and external imaging systems through a modular service-based architecture.
|
|
11
|
+
|
|
12
|
+
The software is designed to make experiments reproducible, configurable, and maintainable by separating:
|
|
13
|
+
- experiment logic and hardware (`protocol.yaml`)
|
|
14
|
+
- stimulus definitions (`playlist.txt`)
|
|
15
|
+
- acquisition callbacks and logs
|
|
16
|
+
|
|
17
|
+
from the underlying device code.
|
|
18
|
+
|
|
19
|
+
See the [documentation](https://janclemenslab.org/etho) for details.
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
Quick installation:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
uv venv --python 3.14
|
|
28
|
+
.venv\Scripts\activate
|
|
29
|
+
uv pip install etho-python
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Some hardware backends require additional vendor SDKs and drivers and specific python versions.
|
|
33
|
+
See the full [installation guide](https://janclemenslab.org/etho/install.html).
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
Etho can be controlled via a GUI. Launch it with:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
etho gui
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Alternatively, experiments can be run from the terminal:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
etho run protocol.yaml
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Data generated by etho can be inspected, annotated, and analyzed with [xarray-behave](https://github.com/janclemenslab/xarray-behave).
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Citation
|
|
54
|
+
|
|
55
|
+
If you use `etho`earch, please cite:
|
|
56
|
+
|
|
57
|
+
```bibtex
|
|
58
|
+
TODO
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
A [JOSS paper](paper/paper.md) describing the software is in preparation.
|
|
62
|
+
|
|
63
|
+
The `etho` software has been used in the following publications:
|
|
64
|
+
|
|
65
|
+
- Vijendravarma, R. K., Narasimha, S., Steinfath, E., Clemens, J., & Leopold, P. (2022). *Drosophila* females have an acoustic preference for symmetric males. Proceedings of the National Academy of Sciences, 119(13), e2116136119. https://doi.org/10.1073/pnas.2116136119
|
|
66
|
+
|
|
67
|
+
- Steinfath, E., Khalili, A., Stenger, M., Schultze, B. L., Nair, S. R., Alizadeh, K., & Clemens, J. (2025). A neural circuit for context-dependent multimodal signaling in *Drosophila*. Nature Communications, 16, 9472. https://doi.org/10.1038/s41467-025-64907-9
|
|
68
|
+
|
|
69
|
+
- Palacios-Muñoz, A., & Clemens, J. (2025). *Drosophila* males integrate song and pheromones using context-specific strategies. bioRxiv. https://doi.org/10.1101/2025.07.25.666755
|
|
70
|
+
|
|
71
|
+
- Ravindran Nair, S., Palacios-Muñoz, A., Martineau, S., Nasr, M., & Clemens, J. (2026). Sex-specific behavioral feedback modulates sensorimotor processing and drives flexible social behavior. Nature Communications, 17, 4026. https://doi.org/10.1038/s41467-026-72057-9
|
|
@@ -32,12 +32,9 @@ the callback accepts options.
|
|
|
32
32
|
|------|---------|
|
|
33
33
|
| `disp` | Display frames with OpenCV. |
|
|
34
34
|
| `disp_fast` | Display frames with pyqtgraph. |
|
|
35
|
-
| `disp_back` | Display a center/back camera helper view. |
|
|
36
|
-
| `disp_top` | Display a center/top camera helper view. |
|
|
37
35
|
| `save_avi` | Save frames with OpenCV `VideoWriter`. |
|
|
38
36
|
| `save_ffmpegcv` | Save frames with an ffmpegcv backend. |
|
|
39
37
|
| `save_vidgear` | Save frames through VidGear. |
|
|
40
|
-
| `save_vidgear_round` | Save rounded/cropped VidGear output. |
|
|
41
38
|
| `save_avi_fast` | Save video with NVIDIA Video Processing Framework. |
|
|
42
39
|
| `saveimg_h5` | Save image frames to HDF5. |
|
|
43
40
|
| `saveimg_zarr` | Save image frames to Zarr. |
|
|
@@ -66,26 +63,4 @@ callbacks:
|
|
|
66
63
|
|
|
67
64
|
## Writing A Callback
|
|
68
65
|
|
|
69
|
-
|
|
70
|
-
files, flush buffers, and call `super()._cleanup()` at the end.
|
|
71
|
-
|
|
72
|
-
```python
|
|
73
|
-
from etho.services.callbacks import register_callback
|
|
74
|
-
from etho.services.callbacks._base import BaseCallback
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
@register_callback
|
|
78
|
-
class CoolCallback(BaseCallback):
|
|
79
|
-
FRIENDLY_NAME = "cool"
|
|
80
|
-
|
|
81
|
-
def _loop(self, data):
|
|
82
|
-
image_or_chunk, timestamps = data
|
|
83
|
-
...
|
|
84
|
-
|
|
85
|
-
def _cleanup(self):
|
|
86
|
-
...
|
|
87
|
-
super()._cleanup()
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Once imported by the callback package, the callback can be selected in a
|
|
91
|
-
protocol by `FRIENDLY_NAME` or class name.
|
|
66
|
+
See [Extensions](extensions.md).
|
|
@@ -18,7 +18,7 @@ sys.path.insert(0, os.path.abspath("../src"))
|
|
|
18
18
|
# -- Project information -----------------------------------------------------
|
|
19
19
|
|
|
20
20
|
project = "etho"
|
|
21
|
-
copyright = "
|
|
21
|
+
copyright = "2026, Jan Clemens"
|
|
22
22
|
author = "Jan Clemens"
|
|
23
23
|
|
|
24
24
|
# -- General configuration ---------------------------------------------------
|
|
@@ -27,6 +27,7 @@ author = "Jan Clemens"
|
|
|
27
27
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
|
28
28
|
# ones.
|
|
29
29
|
extensions = [
|
|
30
|
+
"sphinx_tabs.tabs",
|
|
30
31
|
"sphinx.ext.autodoc",
|
|
31
32
|
"sphinx.ext.coverage",
|
|
32
33
|
"sphinx.ext.napoleon",
|
|
@@ -36,8 +37,9 @@ extensions = [
|
|
|
36
37
|
"sphinx_panels",
|
|
37
38
|
"sphinxcontrib.images",
|
|
38
39
|
"sphinx.ext.autosectionlabel",
|
|
39
|
-
"sphinx_inline_tabs",
|
|
40
40
|
"sphinx_copybutton",
|
|
41
|
+
"sphinx_iconify",
|
|
42
|
+
"sphinx_design",
|
|
41
43
|
]
|
|
42
44
|
|
|
43
45
|
# Add any paths that contain templates here, relative to this directory.
|
|
@@ -55,9 +57,15 @@ exclude_patterns += ["README.md"]
|
|
|
55
57
|
html_static_path = ["_static"]
|
|
56
58
|
|
|
57
59
|
html_theme_options = {
|
|
58
|
-
"
|
|
59
|
-
"light_logo": "
|
|
60
|
-
"dark_logo": "
|
|
60
|
+
"accent_color": "violet",
|
|
61
|
+
"light_logo": "_static/etho_light.svg",
|
|
62
|
+
"dark_logo": "_static/etho_dark.svg",
|
|
63
|
+
"github_url": "https://github.com/janclemenslab/etho",
|
|
64
|
+
"nav_links": [
|
|
65
|
+
{"title": "Installation", "url": "install"},
|
|
66
|
+
{"title": "Tutorial", "url": "tutorial"},
|
|
67
|
+
{"title": "Configuration", "url": "configuration/configuration"},
|
|
68
|
+
],
|
|
61
69
|
}
|
|
62
70
|
|
|
63
71
|
|
|
@@ -98,7 +106,9 @@ autosectionlabel_prefix_document = True
|
|
|
98
106
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
|
99
107
|
# a list of builtin themes.
|
|
100
108
|
#
|
|
101
|
-
html_theme = "furo"
|
|
109
|
+
# html_theme = "furo"
|
|
110
|
+
html_theme = "shibuya"
|
|
111
|
+
|
|
102
112
|
|
|
103
113
|
# Add any paths that contain custom static files (such as style sheets) here,
|
|
104
114
|
# relative to this directory. They are copied after the builtin static files,
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
(extensions)=
|
|
2
|
+
# Extensions
|
|
3
|
+
|
|
4
|
+
Etho has two main extension points:
|
|
5
|
+
|
|
6
|
+
- **Callbacks** process data that an existing service already produces.
|
|
7
|
+
- **Services** add a new hardware controller or long-running process.
|
|
8
|
+
|
|
9
|
+
Use a callback when the `GCM`, `DAQ`, or `DLP` service already gives you the
|
|
10
|
+
data stream you need. Add a service when new hardware needs its own setup,
|
|
11
|
+
start, stop, logging, and progress lifecycle.
|
|
12
|
+
|
|
13
|
+
## Adding A Callback
|
|
14
|
+
|
|
15
|
+
Callbacks are registered in `etho.services.callbacks.callbacks`. Services look
|
|
16
|
+
up protocol callback names in that registry and launch each callback in a
|
|
17
|
+
separate concurrent task.
|
|
18
|
+
|
|
19
|
+
1. Add a callback class under `src/etho/services/callbacks/`.
|
|
20
|
+
2. Subclass `BaseCallback`.
|
|
21
|
+
3. Decorate the class with `@register_callback`.
|
|
22
|
+
4. Set `FRIENDLY_NAME` to the protocol-facing name.
|
|
23
|
+
5. Implement `_loop(self, data)`.
|
|
24
|
+
6. Implement `_cleanup(self)` if the callback opens files, hardware, windows, or
|
|
25
|
+
buffers. Call `super()._cleanup()` at the end.
|
|
26
|
+
7. If the class lives in a new module, import that module from
|
|
27
|
+
`src/etho/services/callbacks/__init__.py` so registration happens at import
|
|
28
|
+
time.
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from etho.services.callbacks import register_callback
|
|
32
|
+
from etho.services.callbacks._base import BaseCallback
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
@register_callback
|
|
36
|
+
class SaveSummary(BaseCallback):
|
|
37
|
+
FRIENDLY_NAME = "save_summary"
|
|
38
|
+
|
|
39
|
+
def __init__(self, data_source, file_name, rate=0, **kwargs):
|
|
40
|
+
super().__init__(data_source, rate=rate)
|
|
41
|
+
self.file_name = file_name
|
|
42
|
+
|
|
43
|
+
def _loop(self, data):
|
|
44
|
+
payload, timestamps = data
|
|
45
|
+
...
|
|
46
|
+
|
|
47
|
+
def _cleanup(self):
|
|
48
|
+
...
|
|
49
|
+
super()._cleanup()
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use the friendly name in the service block:
|
|
53
|
+
|
|
54
|
+
```yaml
|
|
55
|
+
GCM:
|
|
56
|
+
callbacks:
|
|
57
|
+
save_summary:
|
|
58
|
+
rate: 0.5
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Callback constructor arguments come from two places:
|
|
62
|
+
|
|
63
|
+
- The service supplies common arguments such as `file_name`, frame dimensions,
|
|
64
|
+
frame rate, DAQ channel metadata, or input chunk size.
|
|
65
|
+
- The protocol supplies callback-specific options under the callback name.
|
|
66
|
+
|
|
67
|
+
Camera callbacks usually receive `(image, (system_ts, image_ts))`. Timestamp
|
|
68
|
+
callbacks receive timestamp data without the image payload. DAQ callbacks receive
|
|
69
|
+
analog input chunks and metadata from the analog input task.
|
|
70
|
+
|
|
71
|
+
## Adding A Service
|
|
72
|
+
|
|
73
|
+
New services should follow `src/etho/services/TemplateZeroService.py`. A service
|
|
74
|
+
subclasses `BaseZeroService`, exposes a ZeroRPC server, and implements the same
|
|
75
|
+
lifecycle used by the built-in services.
|
|
76
|
+
|
|
77
|
+
1. Copy `TemplateZeroService.py` to
|
|
78
|
+
`src/etho/services/<NAME>ZeroService.py`.
|
|
79
|
+
2. Rename the class to a short uppercase service name, such as `TMP`.
|
|
80
|
+
3. Set unique `LOGGING_PORT` and `SERVICE_PORT` values. Existing services use
|
|
81
|
+
logging ports in the `1420-1460` range and service ports beginning with
|
|
82
|
+
`42`; the last two digits normally match.
|
|
83
|
+
4. Set `SERVICE_NAME` to the class name.
|
|
84
|
+
5. Implement `setup_client(...)` for protocol-to-service wiring. This is where
|
|
85
|
+
the service reads its protocol block, assigns its default port, calls
|
|
86
|
+
`make(...)`, calls the remote `setup(...)`, and initializes the local logger.
|
|
87
|
+
6. Implement `setup(...)` for hardware allocation, run configuration, worker
|
|
88
|
+
thread setup, and `self.info`.
|
|
89
|
+
7. Implement `start()` to start workers, hardware acquisition, timers, and
|
|
90
|
+
callbacks.
|
|
91
|
+
8. Implement `finish(stop_service=False)` to stop timers, signal workers, close
|
|
92
|
+
hardware, close callbacks, and optionally call `service_stop()`.
|
|
93
|
+
9. Implement `is_busy()`, `test()`, and `cleanup()`.
|
|
94
|
+
10. Keep the module-level `cli()` and `if __name__ == "__main__"` block so
|
|
95
|
+
`BaseZeroService.make(...)` can launch the service with `python -m`.
|
|
96
|
+
|
|
97
|
+
The template shows the expected structure:
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
from . import register_service
|
|
101
|
+
from .ZeroService import BaseZeroService
|
|
102
|
+
from .utils.log_exceptions import for_all_methods, log_exceptions
|
|
103
|
+
import logging
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@for_all_methods(log_exceptions(logging.getLogger(__name__)))
|
|
107
|
+
@register_service
|
|
108
|
+
class TMP(BaseZeroService):
|
|
109
|
+
LOGGING_PORT = 1443
|
|
110
|
+
SERVICE_PORT = 4243
|
|
111
|
+
SERVICE_NAME = "TMP"
|
|
112
|
+
CLIENT_START_GROUP = "pre"
|
|
113
|
+
|
|
114
|
+
@classmethod
|
|
115
|
+
def setup_client(cls, service_key, service_index, prot, defaults,
|
|
116
|
+
playlistfile, save_prefix, preview, new_console):
|
|
117
|
+
...
|
|
118
|
+
|
|
119
|
+
def setup(self, duration):
|
|
120
|
+
self.duration = float(duration)
|
|
121
|
+
...
|
|
122
|
+
|
|
123
|
+
def start(self):
|
|
124
|
+
...
|
|
125
|
+
|
|
126
|
+
def finish(self, stop_service=False):
|
|
127
|
+
...
|
|
128
|
+
|
|
129
|
+
def is_busy(self):
|
|
130
|
+
...
|
|
131
|
+
|
|
132
|
+
def test(self):
|
|
133
|
+
...
|
|
134
|
+
|
|
135
|
+
def cleanup(self):
|
|
136
|
+
...
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Services that run continuously should do the work in a thread or hardware task
|
|
140
|
+
created during `setup()` and started during `start()`. Use a `threading.Event`
|
|
141
|
+
or equivalent stop signal so `finish()` can stop the worker cleanly.
|
|
142
|
+
|
|
143
|
+
## Wiring A Service Into Experiments
|
|
144
|
+
|
|
145
|
+
`etho run` looks up services in `etho.services.SERVICE_REGISTRY` by their
|
|
146
|
+
`SERVICE_NAME`. Suffixed protocol names such as `GCM2` resolve to `GCM`. Do not
|
|
147
|
+
edit `src/etho/client.py` for a new service; register the service class with
|
|
148
|
+
`@register_service` and import the service from `src/etho/services/__init__.py`
|
|
149
|
+
so the decorator runs.
|
|
150
|
+
|
|
151
|
+
`setup_client(...)` receives the protocol, global defaults, playlist path,
|
|
152
|
+
`save_prefix`, preview flag, and debug console flag. It should return the
|
|
153
|
+
configured remote service client, or `None` when the service should be skipped
|
|
154
|
+
for that run.
|
|
155
|
+
|
|
156
|
+
Set `CLIENT_START_GROUP` only when start order matters:
|
|
157
|
+
|
|
158
|
+
- `pre`: default; starts before trigger and DAQ services.
|
|
159
|
+
- `trigger`: starts after `pre` services.
|
|
160
|
+
- `daq`: starts after `pre` and `trigger` services, with the existing startup
|
|
161
|
+
delay.
|
|
162
|
+
|
|
163
|
+
Minimal protocol shape:
|
|
164
|
+
|
|
165
|
+
```yaml
|
|
166
|
+
maxduration: 30
|
|
167
|
+
use_services: [TMP]
|
|
168
|
+
|
|
169
|
+
TMP:
|
|
170
|
+
duration: 30
|
|
171
|
+
port: 4243
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
The exact service block should match what the new service's `setup_client(...)`
|
|
175
|
+
passes into its remote `setup(...)` call.
|
|
176
|
+
|
|
177
|
+
## Documentation And Tests
|
|
178
|
+
|
|
179
|
+
When adding a public extension, update the matching docs:
|
|
180
|
+
|
|
181
|
+
- Callback options belong in `docs/callbacks.md` and protocol examples.
|
|
182
|
+
- Service configuration belongs in `docs/configuration/protocol.md`.
|
|
183
|
+
- Hardware-specific behavior belongs under `docs/hardware/`.
|
|
184
|
+
- API pages are automatically generated.
|
|
185
|
+
|
|
186
|
+
For services, add tests around the client wiring and any non-hardware parsing or
|
|
187
|
+
state handling. For callbacks, test constructor options and `_loop()` behavior
|
|
188
|
+
without requiring real hardware when possible.
|
|
@@ -9,6 +9,9 @@ describe the rig-facing hardware assumptions for the services that are commonly
|
|
|
9
9
|
operated from protocols: cameras, National Instruments DAQ devices, DLP
|
|
10
10
|
projectors, and ScanImage trigger integration.
|
|
11
11
|
|
|
12
|
+
You can add support for new hardware by implementing the appropriate service interface. See :ref:`extensions`.
|
|
13
|
+
|
|
14
|
+
|
|
12
15
|
.. toctree::
|
|
13
16
|
:maxdepth: 1
|
|
14
17
|
:hidden:
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.. etho documentation master file, created by
|
|
2
|
+
sphinx-quickstart on Mon Aug 16 20:53:49 2021.
|
|
3
|
+
You can adapt this file completely to your liking, but it should at least
|
|
4
|
+
contain the root `toctree` directive.
|
|
5
|
+
|
|
6
|
+
Etho: A Python framework for coordinating stimuli, data acquisition, and hardware control in neuroscience experiments
|
|
7
|
+
=====================================
|
|
8
|
+
|
|
9
|
+
Etho runs behavioral experiments by coordinating cameras, data acquisition,
|
|
10
|
+
projectors, sensors, playlists, callbacks, and saved outputs from a single
|
|
11
|
+
Python command-line or GUI entry point.
|
|
12
|
+
|
|
13
|
+
.. grid:: 2
|
|
14
|
+
|
|
15
|
+
.. grid-item-card:: Hardware support
|
|
16
|
+
:link: hardware/hardware
|
|
17
|
+
:link-type: doc
|
|
18
|
+
|
|
19
|
+
Etho supports cameras, data acquisition devices, projectors, and sensors
|
|
20
|
+
from multiple vendors.
|
|
21
|
+
|
|
22
|
+
.. grid-item-card:: Text-based configuration
|
|
23
|
+
:link: configuration/configuration
|
|
24
|
+
:link-type: doc
|
|
25
|
+
|
|
26
|
+
Etho uses YAML configuration files for rig and experiment settings, and
|
|
27
|
+
supports dynamic configuration changes during runtime.
|
|
28
|
+
|
|
29
|
+
.. grid-item-card:: Realtime
|
|
30
|
+
:link: logging
|
|
31
|
+
:link-type: doc
|
|
32
|
+
|
|
33
|
+
Etho supports realtime logging of video and audio data, with flexible
|
|
34
|
+
configuration of what data to log and how to save it.
|
|
35
|
+
|
|
36
|
+
.. grid-item-card:: Fast & parallel
|
|
37
|
+
|
|
38
|
+
Etho executes hardware services and logging callbacks in parallel, making use of multi-core and GPU hardware.
|
|
39
|
+
|
|
40
|
+
.. grid-item-card:: Terminal and graphical user interfaces
|
|
41
|
+
:link: cli
|
|
42
|
+
:link-type: doc
|
|
43
|
+
|
|
44
|
+
Etho provides a terminal interface and a GUI for configuring, monitoring, and controlling experiments.
|
|
45
|
+
|
|
46
|
+
.. grid-item-card:: Modular & extensible
|
|
47
|
+
:link: extensions
|
|
48
|
+
:link-type: doc
|
|
49
|
+
|
|
50
|
+
Etho is designed to be easily extended with new hardware support and callbacks.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
.. toctree::
|
|
54
|
+
:maxdepth: 2
|
|
55
|
+
:glob:
|
|
56
|
+
:hidden:
|
|
57
|
+
|
|
58
|
+
Home <self>
|
|
59
|
+
Installation <install>
|
|
60
|
+
Tutorial <tutorial>
|
|
61
|
+
Configuration <configuration/configuration>
|
|
62
|
+
Logging <logging>
|
|
63
|
+
Callbacks <callbacks>
|
|
64
|
+
Extensions <extensions>
|
|
65
|
+
Hardware <hardware/hardware>
|
|
66
|
+
CLI <cli>
|
|
67
|
+
API <api_etho>
|
|
68
|
+
|