etho-python 0.22.0__py3-none-any.whl → 0.23.0__py3-none-any.whl
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/__init__.py +14 -6
- etho/utils/config.py +10 -10
- etho_python-0.23.0.dist-info/METADATA +229 -0
- {etho_python-0.22.0.dist-info → etho_python-0.23.0.dist-info}/RECORD +6 -6
- etho_python-0.22.0.dist-info/METADATA +0 -49
- {etho_python-0.22.0.dist-info → etho_python-0.23.0.dist-info}/WHEEL +0 -0
- {etho_python-0.22.0.dist-info → etho_python-0.23.0.dist-info}/entry_points.txt +0 -0
etho/__init__.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
"""etho"""
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
__version__ = version("etho-python")
|
|
7
|
+
except PackageNotFoundError:
|
|
8
|
+
__version__ = "0+unknown"
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
# load global config on import
|
|
11
|
+
try:
|
|
12
|
+
from .utils.config import defaultify, readconfig
|
|
13
|
+
|
|
14
|
+
config = readconfig()
|
|
15
|
+
except FileNotFoundError:
|
|
16
|
+
print("No configuration file found. Run `etho init`")
|
|
17
|
+
config = defaultify({})
|
etho/utils/config.py
CHANGED
|
@@ -7,10 +7,8 @@ from typing import Dict, Union, Optional
|
|
|
7
7
|
|
|
8
8
|
# Find global config file
|
|
9
9
|
HOME = str(pathlib.Path.home())
|
|
10
|
-
GLOBALCONFIGFILEPATH = os.path.join(HOME, "ethoconfig/ethoconfig.yml")
|
|
11
|
-
|
|
12
|
-
if not os.path.exists(GLOBALCONFIGFILEPATH):
|
|
13
|
-
raise FileNotFoundError("No config file found. Should be at ~/ethoconfig/ethoconfig.yml")
|
|
10
|
+
GLOBALCONFIGFILEPATH = os.path.join(HOME, "ethoconfig/ethoconfig.yml")
|
|
11
|
+
MISSING_CONFIG_MESSAGE = "No config file found. Should be at ~/ethoconfig/ethoconfig.yml"
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
def defaultify(d: Dict, defaultfactory=lambda: None) -> defaultdict:
|
|
@@ -32,10 +30,12 @@ def saveconfig(filename: str, prot: Union[Dict, defaultdict]):
|
|
|
32
30
|
yaml.dump(prot, f)
|
|
33
31
|
|
|
34
32
|
|
|
35
|
-
def readconfig(filename: Optional[str] = None) -> defaultdict:
|
|
36
|
-
if filename is None:
|
|
37
|
-
filename = GLOBALCONFIGFILEPATH
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
def readconfig(filename: Optional[str] = None) -> defaultdict:
|
|
34
|
+
if filename is None:
|
|
35
|
+
filename = GLOBALCONFIGFILEPATH
|
|
36
|
+
if not os.path.exists(filename):
|
|
37
|
+
raise FileNotFoundError(MISSING_CONFIG_MESSAGE)
|
|
38
|
+
|
|
39
|
+
with open(filename, "r") as f:
|
|
40
|
+
config_dict = yaml.load(f.read(), Loader=yaml.FullLoader)
|
|
41
41
|
return defaultify(config_dict)
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: etho-python
|
|
3
|
+
Version: 0.23.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: sphinx-inline-tabs ; 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
|
+
Project-URL: documentation, https://janclemenslab.org/etho/
|
|
44
|
+
Project-URL: source, https://github.com/janclemenslab/etho
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Provides-Extra: doc
|
|
47
|
+
|
|
48
|
+
# `etho`: A Python framework for coordinating stimuli, data acquisition, and hardware control in neuroscience experiments
|
|
49
|
+
|
|
50
|
+
[](https://github.com/janclemenslab/etho/actions/workflows/python-package.yml)
|
|
51
|
+
[](https://janclemenslab.org/etho)
|
|
52
|
+
[](LICENSE)
|
|
53
|
+
|
|
54
|
+
`etho` is an open-source Python framework for running behavioral neuroscience experiments that require coordinated stimulus presentation, hardware control, data acquisition, and experiment logging.
|
|
55
|
+
|
|
56
|
+
It was developed for experiments on acoustic communication and social behavior, 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.
|
|
57
|
+
|
|
58
|
+
The software is designed to make experiments reproducible, configurable, and maintainable by separating:
|
|
59
|
+
- experiment logic (`protocol.yaml`)
|
|
60
|
+
- stimulus definitions (`playlist.txt`)
|
|
61
|
+
- hardware calibration
|
|
62
|
+
- acquisition callbacks
|
|
63
|
+
- service-level logs
|
|
64
|
+
|
|
65
|
+
from the underlying device code.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
- Modular service-based architecture
|
|
72
|
+
- Coordinated control of heterogeneous hardware
|
|
73
|
+
- Human-readable YAML experiment protocols
|
|
74
|
+
- Playlist-based stimulus specification
|
|
75
|
+
- Acoustic and optogenetic stimulus generation
|
|
76
|
+
- National Instruments DAQ integration
|
|
77
|
+
- Multiple camera backends
|
|
78
|
+
- Trigger synchronization with external systems (e.g. ScanImage)
|
|
79
|
+
- Per-service experiment logging
|
|
80
|
+
- HDF5 / Zarr / video data export
|
|
81
|
+
- Command-line and GUI interfaces
|
|
82
|
+
- Calibration workflows for speakers and LEDs
|
|
83
|
+
- Callback system for online display and data processing
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Typical use cases
|
|
88
|
+
|
|
89
|
+
`etho` is intended for experiments requiring synchronized:
|
|
90
|
+
- stimulus playback
|
|
91
|
+
- analog/digital acquisition
|
|
92
|
+
- video recording
|
|
93
|
+
- optogenetic stimulation
|
|
94
|
+
- trigger generation
|
|
95
|
+
- environmental monitoring
|
|
96
|
+
|
|
97
|
+
Typical applications include:
|
|
98
|
+
- acoustic communication experiments
|
|
99
|
+
- behavioral neuroscience
|
|
100
|
+
- sensory stimulation
|
|
101
|
+
- closed-loop experiments
|
|
102
|
+
- imaging synchronization
|
|
103
|
+
- multimodal behavioral assays
|
|
104
|
+
|
|
105
|
+
Although originally developed for *Drosophila* experiments, the framework is not species-specific.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Software architecture
|
|
110
|
+
|
|
111
|
+
The experiment workflow in `etho` is organized around protocols, playlists, services, callbacks, data outputs, and logs.
|
|
112
|
+
|
|
113
|
+

|
|
114
|
+
|
|
115
|
+
1. The user selects an experiment protocol and stimulus playlist.
|
|
116
|
+
2. The experiment controller initializes the requested hardware services.
|
|
117
|
+
3. Services coordinate acquisition and stimulation during the experiment.
|
|
118
|
+
4. Callbacks save and visualize acquired data.
|
|
119
|
+
5. Each service writes detailed logs for debugging and provenance tracking.
|
|
120
|
+
6. Data, configuration, and logs together form a reproducible experiment record.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Installation
|
|
125
|
+
|
|
126
|
+
See the full installation guide:
|
|
127
|
+
|
|
128
|
+
https://janclemenslab.org/etho/install.html
|
|
129
|
+
|
|
130
|
+
Typical installation:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
conda create -n etho -y python=3.13 uv pip
|
|
134
|
+
uv venv etho
|
|
135
|
+
source etho/bin/activate
|
|
136
|
+
uv pip install etho-python
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Some hardware backends require additional vendor SDKs and drivers.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Quick start
|
|
144
|
+
|
|
145
|
+
### Launch GUI
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
etho gui
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Run an experiment
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
etho run protocol.yaml
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Example protocol structure
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
maxduration: 600
|
|
161
|
+
|
|
162
|
+
DAQ:
|
|
163
|
+
samplingrate: 10000
|
|
164
|
+
device: Dev1
|
|
165
|
+
|
|
166
|
+
CAMERAS:
|
|
167
|
+
frame_rate: 100
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Documentation
|
|
173
|
+
|
|
174
|
+
Full documentation is available at:
|
|
175
|
+
|
|
176
|
+
https://janclemenslab.org/etho
|
|
177
|
+
|
|
178
|
+
Documentation includes:
|
|
179
|
+
- installation
|
|
180
|
+
- hardware configuration
|
|
181
|
+
- protocol format
|
|
182
|
+
- playlists
|
|
183
|
+
- calibration
|
|
184
|
+
- callbacks
|
|
185
|
+
- logging
|
|
186
|
+
- API documentation
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Development status
|
|
191
|
+
|
|
192
|
+
`etho` has been under active development since 2018 and is used in ongoing behavioral neuroscience experiments in the Clemens laboratory.
|
|
193
|
+
|
|
194
|
+
The repository contains:
|
|
195
|
+
- automated tests
|
|
196
|
+
- continuous integration
|
|
197
|
+
- documentation
|
|
198
|
+
- example protocols
|
|
199
|
+
- public issue tracking
|
|
200
|
+
|
|
201
|
+
Contributions and bug reports are welcome.
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## Contributing
|
|
206
|
+
|
|
207
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
208
|
+
|
|
209
|
+
If you encounter problems or would like to request features, please open an issue:
|
|
210
|
+
https://github.com/janclemenslab/etho/issues
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Citation
|
|
215
|
+
|
|
216
|
+
If you use `etho` in research, please cite:
|
|
217
|
+
|
|
218
|
+
```bibtex
|
|
219
|
+
TODO
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
A JOSS paper describing the software is currently in preparation.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
## License
|
|
227
|
+
|
|
228
|
+
MIT License.
|
|
229
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
etho/__init__.py,sha256=
|
|
1
|
+
etho/__init__.py,sha256=TRhKWOACEYbH-AH7QSmtYlcW5FQ_DS80QtkWldiG2Ew,412
|
|
2
2
|
etho/app.py,sha256=0bQgZS3d2gxXAZrXeHVIrOpXMmlMWAnX10VEbEvRmJU,19711
|
|
3
3
|
etho/cli.py,sha256=n9YI77ZQ9oxb-2uh-WL9PtVQhQ8uv5Bteo1r2slyrm4,6377
|
|
4
4
|
etho/client.py,sha256=m7fU_yuOLk5xYzlllrJ0YAGkml58-Utm5N3EB7_3yO8,15012
|
|
@@ -35,13 +35,13 @@ etho/services/utils/concurrent_task.py,sha256=nvIYMZc1zgpMc3D_Gs-Je__wK3fcVm5BQh
|
|
|
35
35
|
etho/services/utils/log_exceptions.py,sha256=di4vbfK3YT4ZXtugcaltGeqCh5MMZQ86M1NIyTgUaZo,1059
|
|
36
36
|
etho/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
37
|
etho/utils/calibration.py,sha256=-FMABMS-ReJ4XXR0wUAiAqGizXX5Vlj2NYH4ofiBnpA,3145
|
|
38
|
-
etho/utils/config.py,sha256=
|
|
38
|
+
etho/utils/config.py,sha256=Tp8nxFfrRC6ujU3L6dDRXmh-JQF630jCEoxg63PIzF0,1314
|
|
39
39
|
etho/utils/runner.py,sha256=XiUWQp0ua1DYwHUdgBr5Z_lz5ZVxBVCidPBgjckEaH8,4171
|
|
40
40
|
etho/utils/shuffled_cycle.py,sha256=WvBbNQP-iK7fVoCgHGTDjmT0wJhZm8Rb7IDXIbBcE5Q,1481
|
|
41
41
|
etho/utils/sound.py,sha256=Yjn9IbCo7eHLIxeU2FsgDo1TeBClcG0ujTZcualIdww,13207
|
|
42
42
|
etho/utils/tui.py,sha256=zPaV5ItzOa3QuC3DGMNcTWM4N3El87hnAnTy51lacHs,3777
|
|
43
43
|
etho/utils/zeroclient.py,sha256=3wHR9rtHlESLu9UR1hZRsVisGNpLJKYv2m0sIJUbT08,3498
|
|
44
|
-
etho_python-0.
|
|
45
|
-
etho_python-0.
|
|
46
|
-
etho_python-0.
|
|
47
|
-
etho_python-0.
|
|
44
|
+
etho_python-0.23.0.dist-info/entry_points.txt,sha256=Y9LGGC-42Xm1bv62a_IiLYVq8T2HoPO5fLypuFfqamo,38
|
|
45
|
+
etho_python-0.23.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
46
|
+
etho_python-0.23.0.dist-info/METADATA,sha256=vvnJf7lvaSSVf_7gaRaJmlwbJYmUqnbep4OV4Kd0NSc,5984
|
|
47
|
+
etho_python-0.23.0.dist-info/RECORD,,
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: etho-python
|
|
3
|
-
Version: 0.22.0
|
|
4
|
-
Summary: etho
|
|
5
|
-
Author-email: Jan Clemens <clemensjan@googlemail.com>
|
|
6
|
-
Requires-Python: >3.6
|
|
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: pydaqmx
|
|
27
|
-
Requires-Dist: pyqtgraph
|
|
28
|
-
Requires-Dist: qtpy
|
|
29
|
-
Requires-Dist: PySide6-Essentials
|
|
30
|
-
Requires-Dist: zarr
|
|
31
|
-
Requires-Dist: pytest ; extra == "dev"
|
|
32
|
-
Requires-Dist: flit>=3.2 ; extra == "dev"
|
|
33
|
-
Requires-Dist: sphinx ; extra == "doc"
|
|
34
|
-
Requires-Dist: furo ; extra == "doc"
|
|
35
|
-
Requires-Dist: sphinx-inline-tabs ; extra == "doc"
|
|
36
|
-
Requires-Dist: sphinx-copybutton ; extra == "doc"
|
|
37
|
-
Requires-Dist: ghp-import ; extra == "doc"
|
|
38
|
-
Requires-Dist: myst-nb ; extra == "doc"
|
|
39
|
-
Requires-Dist: sphinx-panels ; extra == "doc"
|
|
40
|
-
Requires-Dist: sphinxcontrib-images ; extra == "doc"
|
|
41
|
-
Project-URL: documentation, https://janclemenslab.org/etho/
|
|
42
|
-
Project-URL: source, https://github.com/janclemenslab/etho
|
|
43
|
-
Provides-Extra: dev
|
|
44
|
-
Provides-Extra: doc
|
|
45
|
-
|
|
46
|
-
# Etho
|
|
47
|
-
|
|
48
|
-
See [docs](https://janclemenslab.org/etho) for information on how to [install](https://janclemenslab.org/etho/install.html) and use.
|
|
49
|
-
|
|
File without changes
|
|
File without changes
|