Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1e2ae8b
Drop support for Python 3.7 and 3.8
joschaschmiedt Apr 1, 2025
10bd827
Add type hints and Metadata dataclasses
joschaschmiedt Apr 1, 2025
a7ac4b8
Fix wrong source_processor_name dict key
joschaschmiedt Apr 1, 2025
2c357bb
Add type hints to BinaryRecording classes
joschaschmiedt Apr 3, 2025
ecd427b
Fix erroneous float63 dypte
joschaschmiedt Apr 3, 2025
1c915b2
Add test data sets for Binary and OpenEphys formats
joschaschmiedt Apr 3, 2025
d8d6f35
Add abstract base classes AbstractSpikes and AbstractContinuous
joschaschmiedt Apr 3, 2025
30a89c7
Update CHANGELOG.md
joschaschmiedt Apr 3, 2025
7477aba
Add test for reading binary format
joschaschmiedt Apr 3, 2025
19e9a52
Add uv lock file for reproducible dev environment
joschaschmiedt Apr 3, 2025
e8ab842
Add test for reading OpenEphys format
joschaschmiedt Apr 3, 2025
2793e30
Add GitHub action for running pytest
joschaschmiedt Apr 3, 2025
a85aebc
Change version to 0.2.0-dev
joschaschmiedt Apr 3, 2025
7d95e3d
Add json schema for oebin file
joschaschmiedt Apr 4, 2025
adca358
Add __str__ for binary format Continuous and Spike
joschaschmiedt Apr 4, 2025
7e8a596
Fix bug in binary Spike __str__
joschaschmiedt Apr 4, 2025
a13e07d
Rename AbstractContinuous to Continuous
joschaschmiedt Apr 7, 2025
c5f163d
Add NWB test dataset
joschaschmiedt Apr 7, 2025
26c0897
Add tests for NWB2 format
joschaschmiedt Apr 7, 2025
540e0e0
Add RecordingFormat enum
joschaschmiedt Apr 7, 2025
d16118a
Update LICENSE
joschaschmiedt Apr 7, 2025
743b970
Update CHANGELOG.md
joschaschmiedt Apr 7, 2025
3f00120
Add docstring to Continuous.get_samples
joschaschmiedt Apr 8, 2025
b992677
Add type hints to RecordNode
joschaschmiedt Apr 8, 2025
7ee5f4a
Minor cleanup and LICENSE update
joschaschmiedt Apr 9, 2025
3942140
Add type hints to Session
joschaschmiedt Apr 9, 2025
0ea4856
Update CHANGELOG.md
joschaschmiedt Apr 9, 2025
047cc53
Add vscode to gitignore
joschaschmiedt Apr 9, 2025
4b38120
Update CHANGELOG.md
joschaschmiedt Apr 9, 2025
299c5c9
Update CHANGELOG.md
joschaschmiedt Apr 9, 2025
c2e267b
Fix uv version in GH action
joschaschmiedt Apr 9, 2025
5dded08
Merge branch 'main' into add-tests
joschaschmiedt May 6, 2025
9818c5f
Fix bug in printing of record node
joschaschmiedt Jun 16, 2025
37e2e5b
Change RecordingFormat to StrEnum
joschaschmiedt Jun 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
run: uv python install
- name: Install the project
run: uv sync --extra dev
- name: Run tests
run: uv run pytest tests

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ dist
Notebooks
notebooks

.vscode
.spyproject
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# `open-ephys-python-tools` Changelog

## Unreleased

- Dropped support for Python < 3.9
- Refactoring without new functionality or API changes
- The `Continuous` and `Spike` classes of the three formats now have an explicit interface
(i.e. abstract parent class) and have been renamed to `BinaryContinuous`, `BinarySpike` etc.
- The metadata of `Continuous` and `Spike` in the analysis package now are typed dataclasses
instead of `dict` objects . This makes accessing metadata more reliable.
- Type hints have been added to the `analysis` package.
- Automated tests for reading Binary, NWB and OpenEphys data formats have been added.
- Added a `RecordingFormat` enum for the three formats
- Added a JSON schema for validating oebin files
- Added a `uv.lock` file for reproducible development environments.
- `BinaryContinuous` and `BinarySpike` now have `__str__` methods to give an overview over
their contents.

## 0.1.4

- Include `source_processor_id` and `source_processor_name` when writing .oebin file
Expand Down
18 changes: 14 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
Copyright 2020 Open Ephys
Copyright 2020-2025 Open Ephys

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
24 changes: 12 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@ build-backend = "setuptools.build_meta"
[project]
name = "open-ephys-python-tools"
description = "Software tools for interfacing with the Open Ephys GUI"
license = {text = "MIT"}
requires-python = ">=3.7"
license = { text = "MIT" }
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"
"Operating System :: OS Independent",
]
readme = "README.md"

dynamic = ["version"]

dependencies = [
'numpy',
'pandas',
'h5py',
'zmq',
'requests'
]
dependencies = ['numpy', 'pandas', 'h5py', 'zmq', 'requests']

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.dynamic]
version = {attr = "open_ephys.__version__"}

version = { attr = "open_ephys.__version__" }

[dependency-groups]
dev = [
"black>=25.1.0",
"jsonschema>=4.23.0",
"mypy>=1.15.0",
"pytest>=8.3.5",
]
2 changes: 1 addition & 1 deletion src/open_ephys/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.13"
__version__ = "0.2.0-dev"
4 changes: 2 additions & 2 deletions src/open_ephys/analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Each `continuous` object has four properties:
- `samples` - a `numpy.ndarray` that holds the actual continuous data with dimensions of samples x channels. For Binary, NWB, and Kwik format, this will be a memory-mapped array (i.e., the data will only be loaded into memory when specific samples are accessed).
- `sample_numbers` - a `numpy.ndarray` that holds the sample numbers since the start of acquisition. This will have the same size as the first dimension of the `samples` array
- `timestamps` - a `numpy.ndarray` that holds global timestamps (in seconds) for each sample, assuming all data streams were synchronized in this recording. This will have the same size as the first dimension of the `samples` array
- `metadata` - a `dict` containing information about this data, such as the ID of the processor it originated from.
- `metadata` - a `ContinousMetadata` dataclass containing information about this data, such as the ID of the processor it originated from.

Because the memory-mapped samples are stored as 16-bit integers in arbitrary units, all analysis should be done on a scaled version of these samples. To load the samples scaled to microvolts, use the `get_samples()` method:

Expand Down Expand Up @@ -124,7 +124,7 @@ If spike data has been saved by your Record Node (i.e., there is a Spike Detecto
- `sample_numbers` - `numpy.ndarray` of sample indices (one per spikes)
- `timestamps` - `numpy.ndarray` of global timestamps (in seconds)
- `clusters` - `numpy.ndarray` of cluster IDs for each spike (default cluster = 0)
- `metadata` - `dict` with metadata about each electrode
- `metadata` - `SpikeMetadata` dataclass with metadata about each electrode

## Synchronizing timestamps

Expand Down
Loading