npc-ephys 0.1.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.
- npc-ephys-0.1.1/LICENSE +22 -0
- npc-ephys-0.1.1/PKG-INFO +56 -0
- npc-ephys-0.1.1/README.md +30 -0
- npc-ephys-0.1.1/pyproject.toml +240 -0
- npc-ephys-0.1.1/setup.cfg +4 -0
- npc-ephys-0.1.1/src/npc_ephys/__init__.py +44 -0
- npc-ephys-0.1.1/src/npc_ephys/barcodes.py +347 -0
- npc-ephys-0.1.1/src/npc_ephys/openephys.py +729 -0
- npc-ephys-0.1.1/src/npc_ephys/py.typed +0 -0
- npc-ephys-0.1.1/src/npc_ephys/settings_xml.py +245 -0
- npc-ephys-0.1.1/src/npc_ephys/spikeinterface.py +408 -0
- npc-ephys-0.1.1/src/npc_ephys/units.py +337 -0
- npc-ephys-0.1.1/src/npc_ephys.egg-info/PKG-INFO +56 -0
- npc-ephys-0.1.1/src/npc_ephys.egg-info/SOURCES.txt +16 -0
- npc-ephys-0.1.1/src/npc_ephys.egg-info/dependency_links.txt +1 -0
- npc-ephys-0.1.1/src/npc_ephys.egg-info/requires.txt +6 -0
- npc-ephys-0.1.1/src/npc_ephys.egg-info/top_level.txt +1 -0
- npc-ephys-0.1.1/tests/test_core.py +5 -0
npc-ephys-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Allen Institute for Neural Dynamics
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
npc-ephys-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: npc-ephys
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Tools for accessing and processing raw ephys data, compatible with data in the cloud.
|
|
5
|
+
Author-email: Ben Hardcastle <ben.hardcastle@alleninstitue.org>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/AllenInstitute/npc_ephys
|
|
8
|
+
Project-URL: Issues, https://github.com/AllenInstitute/npc_ephys/issues
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
16
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
17
|
+
Requires-Python: >=3.9
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: npc-sync>=0.1.2
|
|
21
|
+
Requires-Dist: zarr>=2.16.1
|
|
22
|
+
Requires-Dist: pandas>=2.2.0
|
|
23
|
+
Requires-Dist: tqdm>=4.66.1
|
|
24
|
+
Requires-Dist: npc-lims>=0.1.115
|
|
25
|
+
Requires-Dist: wavpack-numcodecs>=0.1.5
|
|
26
|
+
|
|
27
|
+
# npc_ephys
|
|
28
|
+
|
|
29
|
+
Tools for accessing and processing raw ephys data, compatible with data in the cloud.
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/npc_ephys/)
|
|
32
|
+
[](https://pypi.org/project/npc_ephys/)
|
|
33
|
+
|
|
34
|
+
[](https://app.codecov.io/github/AllenInstitute/npc_ephys)
|
|
35
|
+
[](https://github.com/AllenInstitute/npc_ephys/actions/workflows/publish.yml)
|
|
36
|
+
[](https://github.com/AllenInstitute/npc_ephys/issues)
|
|
37
|
+
|
|
38
|
+
# Usage
|
|
39
|
+
```bash
|
|
40
|
+
conda create -n npc_ephys python>=3.9
|
|
41
|
+
conda activate npc_ephys
|
|
42
|
+
pip install npc_ephys
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Windows
|
|
46
|
+
[`wavpack-numcodecs`](https://github.com/AllenNeuralDynamics/wavpack-numcodecs)
|
|
47
|
+
is used to read compressed ephys data from S3 (stored in Zarr format). On Windows, that requires C++
|
|
48
|
+
build tools to be installed: if `pip install npc_ephys` fails you'll likely need to download it [from here](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022).
|
|
49
|
+
|
|
50
|
+
## Python
|
|
51
|
+
```python
|
|
52
|
+
>>> import npc_ephys
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
# Development
|
|
56
|
+
See instructions in https://github.com/AllenInstitute/npc_ephys/CONTRIBUTING.md and the original template: https://github.com/AllenInstitute/copier-pdm-npc/blob/main/README.md
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# npc_ephys
|
|
2
|
+
|
|
3
|
+
Tools for accessing and processing raw ephys data, compatible with data in the cloud.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/npc_ephys/)
|
|
6
|
+
[](https://pypi.org/project/npc_ephys/)
|
|
7
|
+
|
|
8
|
+
[](https://app.codecov.io/github/AllenInstitute/npc_ephys)
|
|
9
|
+
[](https://github.com/AllenInstitute/npc_ephys/actions/workflows/publish.yml)
|
|
10
|
+
[](https://github.com/AllenInstitute/npc_ephys/issues)
|
|
11
|
+
|
|
12
|
+
# Usage
|
|
13
|
+
```bash
|
|
14
|
+
conda create -n npc_ephys python>=3.9
|
|
15
|
+
conda activate npc_ephys
|
|
16
|
+
pip install npc_ephys
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Windows
|
|
20
|
+
[`wavpack-numcodecs`](https://github.com/AllenNeuralDynamics/wavpack-numcodecs)
|
|
21
|
+
is used to read compressed ephys data from S3 (stored in Zarr format). On Windows, that requires C++
|
|
22
|
+
build tools to be installed: if `pip install npc_ephys` fails you'll likely need to download it [from here](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022).
|
|
23
|
+
|
|
24
|
+
## Python
|
|
25
|
+
```python
|
|
26
|
+
>>> import npc_ephys
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
# Development
|
|
30
|
+
See instructions in https://github.com/AllenInstitute/npc_ephys/CONTRIBUTING.md and the original template: https://github.com/AllenInstitute/copier-pdm-npc/blob/main/README.md
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "npc-ephys"
|
|
3
|
+
description = "Tools for accessing and processing raw ephys data, compatible with data in the cloud."
|
|
4
|
+
authors = [
|
|
5
|
+
{ name = "Ben Hardcastle", email = "ben.hardcastle@alleninstitue.org" },
|
|
6
|
+
]
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
requires-python = ">=3.9"
|
|
9
|
+
dependencies = [
|
|
10
|
+
"npc-sync>=0.1.2",
|
|
11
|
+
"zarr>=2.16.1",
|
|
12
|
+
"pandas>=2.2.0",
|
|
13
|
+
"tqdm>=4.66.1",
|
|
14
|
+
"npc-lims>=0.1.115",
|
|
15
|
+
"wavpack-numcodecs>=0.1.5",
|
|
16
|
+
]
|
|
17
|
+
version = "0.1.1"
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Development Status :: 3 - Alpha",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: Microsoft :: Windows",
|
|
26
|
+
"Operating System :: POSIX :: Linux",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.license]
|
|
30
|
+
text = "MIT"
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Repository = "https://github.com/AllenInstitute/npc_ephys"
|
|
34
|
+
Issues = "https://github.com/AllenInstitute/npc_ephys/issues"
|
|
35
|
+
|
|
36
|
+
[build-system]
|
|
37
|
+
requires = [
|
|
38
|
+
"setuptools>=61",
|
|
39
|
+
"wheel",
|
|
40
|
+
]
|
|
41
|
+
build-backend = "setuptools.build_meta"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.packages.find]
|
|
44
|
+
where = [
|
|
45
|
+
"src",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.package-data]
|
|
49
|
+
npc_ephys = [
|
|
50
|
+
"py.typed",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[tool.black]
|
|
54
|
+
target-version = [
|
|
55
|
+
"py39",
|
|
56
|
+
"py310",
|
|
57
|
+
"py311",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.ruff]
|
|
61
|
+
line-length = 100
|
|
62
|
+
select = [
|
|
63
|
+
"B",
|
|
64
|
+
"C4",
|
|
65
|
+
"E",
|
|
66
|
+
"F",
|
|
67
|
+
"PGH",
|
|
68
|
+
"RUF",
|
|
69
|
+
"W",
|
|
70
|
+
"YTT",
|
|
71
|
+
"ANN",
|
|
72
|
+
"C",
|
|
73
|
+
"I",
|
|
74
|
+
"RUF100",
|
|
75
|
+
"N",
|
|
76
|
+
"UP",
|
|
77
|
+
]
|
|
78
|
+
src = [
|
|
79
|
+
"src",
|
|
80
|
+
]
|
|
81
|
+
extend-exclude = [
|
|
82
|
+
"tests/fixtures",
|
|
83
|
+
]
|
|
84
|
+
target-version = "py39"
|
|
85
|
+
|
|
86
|
+
[tool.ruff.flake8-tidy-imports]
|
|
87
|
+
ban-relative-imports = "all"
|
|
88
|
+
|
|
89
|
+
[tool.ruff.mccabe]
|
|
90
|
+
max-complexity = 10
|
|
91
|
+
|
|
92
|
+
[tool.coverage.paths]
|
|
93
|
+
source = [
|
|
94
|
+
"src",
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[tool.coverage.run]
|
|
98
|
+
branch = true
|
|
99
|
+
source = [
|
|
100
|
+
"src",
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
[tool.coverage.report]
|
|
104
|
+
skip_covered = true
|
|
105
|
+
show_missing = true
|
|
106
|
+
skip_empty = true
|
|
107
|
+
exclude_also = [
|
|
108
|
+
"raise AssertionError",
|
|
109
|
+
"raise NotImplementedError",
|
|
110
|
+
"if __name__ == .__main__.:",
|
|
111
|
+
"@(abc.)?abstractmethod",
|
|
112
|
+
"@typing.runtime_checkable",
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
[tool.pytest.ini_options]
|
|
116
|
+
addopts = [
|
|
117
|
+
"--import-mode=importlib",
|
|
118
|
+
"--doctest-modules",
|
|
119
|
+
"--ignore-glob=*scripts*,*examples*,*docs*",
|
|
120
|
+
"--cov",
|
|
121
|
+
"--cov-report=html",
|
|
122
|
+
"--cov-config=pyproject.toml",
|
|
123
|
+
"--doctest-glob=*README.md",
|
|
124
|
+
"-x",
|
|
125
|
+
]
|
|
126
|
+
doctest_optionflags = [
|
|
127
|
+
"NORMALIZE_WHITESPACE",
|
|
128
|
+
"IGNORE_EXCEPTION_DETAIL",
|
|
129
|
+
"ELLIPSIS",
|
|
130
|
+
]
|
|
131
|
+
testpaths = [
|
|
132
|
+
"src",
|
|
133
|
+
"tests",
|
|
134
|
+
]
|
|
135
|
+
|
|
136
|
+
[tool.mypy]
|
|
137
|
+
check_untyped_defs = false
|
|
138
|
+
disallow_untyped_defs = false
|
|
139
|
+
disallow_incomplete_defs = false
|
|
140
|
+
disallow_untyped_decorators = false
|
|
141
|
+
disallow_any_unimported = false
|
|
142
|
+
warn_return_any = false
|
|
143
|
+
warn_unused_ignores = true
|
|
144
|
+
no_implicit_optional = true
|
|
145
|
+
show_error_codes = true
|
|
146
|
+
ignore_missing_imports = true
|
|
147
|
+
implicit_reexport = false
|
|
148
|
+
exclude = [
|
|
149
|
+
"src/npc_ephys/scripts",
|
|
150
|
+
]
|
|
151
|
+
|
|
152
|
+
[tool.isort]
|
|
153
|
+
profile = "black"
|
|
154
|
+
atomic = true
|
|
155
|
+
skip_glob = [
|
|
156
|
+
"*/setup.py",
|
|
157
|
+
]
|
|
158
|
+
filter_files = true
|
|
159
|
+
known_first_party = [
|
|
160
|
+
"npc_ephys",
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
[tool.pdm]
|
|
164
|
+
plugins = [
|
|
165
|
+
"pdm-bump",
|
|
166
|
+
"copier",
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
[tool.pdm.build]
|
|
170
|
+
package-dir = "src"
|
|
171
|
+
|
|
172
|
+
[tool.pdm.dev-dependencies]
|
|
173
|
+
dev = [
|
|
174
|
+
"pytest>=7.4.0",
|
|
175
|
+
"ruff>=0.0.282",
|
|
176
|
+
"mypy>=1.4.1",
|
|
177
|
+
"pytest-cov>=4.1.0",
|
|
178
|
+
"black>=23.7.0",
|
|
179
|
+
"git-changelog>=2.3",
|
|
180
|
+
"parver>=0.3",
|
|
181
|
+
]
|
|
182
|
+
docs = [
|
|
183
|
+
"markdown-callouts>=0.3",
|
|
184
|
+
"markdown-exec>=1.7",
|
|
185
|
+
"mkdocs>=1.5",
|
|
186
|
+
"mkdocs-coverage>=1.0",
|
|
187
|
+
"mkdocs-gen-files>=0.5",
|
|
188
|
+
"mkdocs-git-committers-plugin-2>=1.2",
|
|
189
|
+
"mkdocs-git-revision-date-localized-plugin>=1.2",
|
|
190
|
+
"mkdocs-literate-nav>=0.6",
|
|
191
|
+
"mkdocs-material>=9.4",
|
|
192
|
+
"mkdocs-minify-plugin>=0.7",
|
|
193
|
+
"mkdocstrings[python]>=0.23",
|
|
194
|
+
"tomli>=2.0; python_version < '3.11'",
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
[tool.pdm.scripts]
|
|
198
|
+
ruff = "ruff check src --fix-only"
|
|
199
|
+
black = "black src"
|
|
200
|
+
pytest = "pytest --cov-report term-missing:skip-covered --cov-report=html"
|
|
201
|
+
mypy = "mypy src --install-types --non-interactive"
|
|
202
|
+
log = "git-changelog -o CHANGELOG.md"
|
|
203
|
+
dryrun = "pdm publish --repository testpypi --dry-run"
|
|
204
|
+
post_init = "pdm install --plugins"
|
|
205
|
+
|
|
206
|
+
[tool.pdm.scripts.test]
|
|
207
|
+
composite = [
|
|
208
|
+
"pdm run mypy",
|
|
209
|
+
"pdm run pytest",
|
|
210
|
+
]
|
|
211
|
+
|
|
212
|
+
[tool.pdm.scripts.docs]
|
|
213
|
+
shell = "cd docs && mkdocs serve"
|
|
214
|
+
help = "Start the dev server for doc preview"
|
|
215
|
+
|
|
216
|
+
[tool.pdm.scripts.bumpver]
|
|
217
|
+
composite = [
|
|
218
|
+
"pdm self add pdm-bump",
|
|
219
|
+
"pdm bump micro",
|
|
220
|
+
]
|
|
221
|
+
|
|
222
|
+
[tool.pdm.scripts.tag]
|
|
223
|
+
composite = [
|
|
224
|
+
"pdm self add pdm-bump",
|
|
225
|
+
"pdm bump tag",
|
|
226
|
+
]
|
|
227
|
+
|
|
228
|
+
[tool.pdm.scripts.pre_build]
|
|
229
|
+
composite = [
|
|
230
|
+
"pdm run black",
|
|
231
|
+
"pdm run ruff",
|
|
232
|
+
"pdm run bumpver",
|
|
233
|
+
]
|
|
234
|
+
|
|
235
|
+
[tool.pdm.scripts.post_build]
|
|
236
|
+
composite = [
|
|
237
|
+
"git commit -am 'Bump'",
|
|
238
|
+
"pdm run tag",
|
|
239
|
+
"pdm run log",
|
|
240
|
+
]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tools for accessing and processing raw ephys data, compatible with data in the cloud.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import doctest
|
|
6
|
+
import importlib.metadata
|
|
7
|
+
import logging
|
|
8
|
+
|
|
9
|
+
from npc_ephys.barcodes import *
|
|
10
|
+
|
|
11
|
+
# import functions from submodules here:
|
|
12
|
+
from npc_ephys.openephys import *
|
|
13
|
+
from npc_ephys.settings_xml import *
|
|
14
|
+
from npc_ephys.spikeinterface import *
|
|
15
|
+
from npc_ephys.units import *
|
|
16
|
+
|
|
17
|
+
logger = logging.getLogger(__name__)
|
|
18
|
+
|
|
19
|
+
__version__ = importlib.metadata.version("npc_ephys")
|
|
20
|
+
logger.debug(f"{__name__}.{__version__ = }")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def testmod(**testmod_kwargs) -> doctest.TestResults:
|
|
24
|
+
"""
|
|
25
|
+
Run doctests for the module, configured to ignore exception details and
|
|
26
|
+
normalize whitespace.
|
|
27
|
+
|
|
28
|
+
Accepts kwargs to pass to doctest.testmod().
|
|
29
|
+
|
|
30
|
+
Add to modules to run doctests when run as a script:
|
|
31
|
+
.. code-block:: text
|
|
32
|
+
if __name__ == "__main__":
|
|
33
|
+
from npc_io import testmod
|
|
34
|
+
testmod()
|
|
35
|
+
|
|
36
|
+
"""
|
|
37
|
+
_ = testmod_kwargs.setdefault(
|
|
38
|
+
"optionflags", doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
|
|
39
|
+
)
|
|
40
|
+
return doctest.testmod(**testmod_kwargs)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
if __name__ == "__main__":
|
|
44
|
+
testmod()
|