diff --git a/.github/labeler.yml b/.github/labeler.yml index 6b57dcd06..a188014a0 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -12,7 +12,7 @@ "Package: EEG chunker": - changed-files: - - any-glob-to-any-file: 'python/loris_eeg_chunker/**' + - any-glob-to-any-file: 'python/loris_ephys_chunker/**' "Package: Utilities": - changed-files: diff --git a/pyproject.toml b/pyproject.toml index d6979751a..2c1763059 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,9 +25,9 @@ dependencies = [ "scipy", "sqlalchemy>=2.0.0", "virtualenv", - "loris-bids-reader @ {root:uri}/python/loris_bids_reader", - "loris-eeg-chunker @ {root:uri}/python/loris_eeg_chunker", - "loris-utils @ {root:uri}/python/loris_utils", + "loris-bids-reader @ {root:uri}/python/loris_bids_reader", + "loris-ephys-chunker @ {root:uri}/python/loris_ephys_chunker", + "loris-utils @ {root:uri}/python/loris_utils", ] [project.optional-dependencies] @@ -53,9 +53,9 @@ packages = [ members = ["python/loris_*"] [tool.uv.sources] -loris_bids_reader = { workspace = true } -loris_eeg_chunker = { workspace = true } -loris_utils = { workspace = true } +loris_bids_reader = { workspace = true } +loris_ephys_chunker = { workspace = true } +loris_utils = { workspace = true } [tool.ruff] src = ["python"] @@ -94,11 +94,11 @@ include = [ "python/scripts/import_dicom_study.py", "python/scripts/summarize_dicom_study.py", "python/loris_bids_reader", - "python/loris_eeg_chunker", + "python/loris_ephys_chunker", "python/loris_utils", ] exclude = [ - "python/loris_eeg_chunker/src/loris_eeg_chunker/protocol_buffers", + "python/loris_ephys_chunker/src/loris_ephys_chunker/protocol_buffers", ] typeCheckingMode = "strict" reportMissingTypeStubs = "none" diff --git a/python/loris_eeg_chunker/README.md b/python/loris_eeg_chunker/README.md deleted file mode 100644 index 18fd0f892..000000000 --- a/python/loris_eeg_chunker/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# LORIS EEG chunker - -Set of scripts to chunk EEG data in smaller bits for the React viewer of LORIS. - -These scripts were extracted on July 8th, 2019 from the master branch of the -following Github repository https://github.com/ArminTaheri/react-series-data-viewer. - -Author: Armin Taheri; armin.taheri@mcgill.ca diff --git a/python/loris_ephys_chunker/README.md b/python/loris_ephys_chunker/README.md new file mode 100644 index 000000000..ab2bc6bae --- /dev/null +++ b/python/loris_ephys_chunker/README.md @@ -0,0 +1,35 @@ +# LORIS electrophysiology chunker + +## Description + +A set of scripts to chunk EEG and MEG data in smaller bits for visualization in the LORIS electrophysiology browser. + +## Installation + +The LORIS electrophysiology chunker can be installed as a Python package by using the following command from the root LORIS Python directory: + +```sh +pip install python/loris_ephys_chunker +``` + +## Scripts + +The LORIS electrophysiology chunker currently supports the following file types with the following scripts: +- EEG EDF: `edf-to-chunks` +- EEG EEGLAB: `eeglab-to-chunks` +- MEG CTF: `ctf-to-chunks` + +## Use + +The LORIS electrophysiology chunker can be used using the following command: + +```sh +script path/to/acquisition -d path/to/destination/dir +``` + +## Credits + +These scripts were extracted on July 8th, 2019 from the master branch of the following Github repository: +https://github.com/ArminTaheri/react-series-data-viewer. + +Author: Armin Taheri; armin.taheri@mcgill.ca diff --git a/python/loris_eeg_chunker/pyproject.toml b/python/loris_ephys_chunker/pyproject.toml similarity index 57% rename from python/loris_eeg_chunker/pyproject.toml rename to python/loris_ephys_chunker/pyproject.toml index 7ce83ca9f..d29278854 100644 --- a/python/loris_eeg_chunker/pyproject.toml +++ b/python/loris_ephys_chunker/pyproject.toml @@ -1,7 +1,7 @@ [project] -name = "loris-eeg-chunker" +name = "loris-ephys-chunker" version = "27.0.0" -description = "The LORIS EEG chunker" +description = "The LORIS electrophysiology chunker" readme = "README.md" license = "GPL-3.0-or-later" requires-python = ">= 3.11" @@ -15,16 +15,16 @@ dependencies = [ ] [project.scripts] -ctf-to-chunks = "loris_eeg_chunker.scripts.ctf_to_chunks:main" -edf-to-chunks = "loris_eeg_chunker.scripts.edf_to_chunks:main" -eeglab-to-chunks = "loris_eeg_chunker.scripts.eeglab_to_chunks:main" +ctf-to-chunks = "loris_ephys_chunker.scripts.ctf_to_chunks:main" +edf-to-chunks = "loris_ephys_chunker.scripts.edf_to_chunks:main" +eeglab-to-chunks = "loris_ephys_chunker.scripts.eeglab_to_chunks:main" [build-system] requires = ["hatchling"] build-backend = "hatchling.build" [tool.hatch.build.targets.wheel] -packages = ["src/loris_eeg_chunker"] +packages = ["src/loris_ephys_chunker"] [tool.ruff] extend = "../../pyproject.toml" diff --git a/python/loris_eeg_chunker/src/loris_eeg_chunker/chunking.py b/python/loris_ephys_chunker/src/loris_ephys_chunker/chunking.py similarity index 99% rename from python/loris_eeg_chunker/src/loris_eeg_chunker/chunking.py rename to python/loris_ephys_chunker/src/loris_ephys_chunker/chunking.py index 21f2191d7..d95e84839 100644 --- a/python/loris_eeg_chunker/src/loris_eeg_chunker/chunking.py +++ b/python/loris_ephys_chunker/src/loris_ephys_chunker/chunking.py @@ -11,7 +11,7 @@ from mne.io import BaseRaw from scipy import signal -from loris_eeg_chunker.protocol_buffers import chunk_pb2 as chunk_pb +from loris_ephys_chunker.protocol_buffers import chunk_pb2 as chunk_pb ChannelArray = npt.NDArray[np.float64] diff --git a/python/loris_eeg_chunker/src/loris_eeg_chunker/protocol_buffers/chunk_pb2.py b/python/loris_ephys_chunker/src/loris_ephys_chunker/protocol_buffers/chunk_pb2.py similarity index 100% rename from python/loris_eeg_chunker/src/loris_eeg_chunker/protocol_buffers/chunk_pb2.py rename to python/loris_ephys_chunker/src/loris_ephys_chunker/protocol_buffers/chunk_pb2.py diff --git a/python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/ctf_to_chunks.py b/python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/ctf_to_chunks.py similarity index 97% rename from python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/ctf_to_chunks.py rename to python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/ctf_to_chunks.py index df8f74144..c8cbe7f66 100755 --- a/python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/ctf_to_chunks.py +++ b/python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/ctf_to_chunks.py @@ -8,7 +8,7 @@ import mne.io from mne.io.ctf import RawCTF -from loris_eeg_chunker.chunking import write_chunk_directory # type: ignore +from loris_ephys_chunker.chunking import write_chunk_directory # type: ignore def load_channels(path: Path) -> RawCTF: diff --git a/python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/edf_to_chunks.py b/python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/edf_to_chunks.py similarity index 98% rename from python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/edf_to_chunks.py rename to python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/edf_to_chunks.py index 579342e3c..2bca0b846 100755 --- a/python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/edf_to_chunks.py +++ b/python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/edf_to_chunks.py @@ -10,7 +10,7 @@ import mne.io.edf.edf as mne_edf from mne.io.edf.edf import RawEDF -from loris_eeg_chunker.chunking import write_chunk_directory +from loris_ephys_chunker.chunking import write_chunk_directory def load_channels(exclude: list[str]) -> Callable[[Path], RawEDF]: diff --git a/python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/eeglab_to_chunks.py b/python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/eeglab_to_chunks.py similarity index 97% rename from python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/eeglab_to_chunks.py rename to python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/eeglab_to_chunks.py index bff2f78e0..69ff32569 100755 --- a/python/loris_eeg_chunker/src/loris_eeg_chunker/scripts/eeglab_to_chunks.py +++ b/python/loris_ephys_chunker/src/loris_ephys_chunker/scripts/eeglab_to_chunks.py @@ -9,7 +9,7 @@ import mne.io.eeglab.eeglab as mne_eeglab from mne.io.eeglab.eeglab import RawEEGLAB -from loris_eeg_chunker.chunking import write_chunk_directory +from loris_ephys_chunker.chunking import write_chunk_directory def load_channels(path: Path) -> RawEEGLAB: diff --git a/test/pyrightconfig.json b/test/pyrightconfig.json index db8f29771..f9312f9c5 100644 --- a/test/pyrightconfig.json +++ b/test/pyrightconfig.json @@ -1,6 +1,6 @@ { "include": ["../python"], - "exclude": ["../python/loris_eeg_chunker/protocol_buffers"], + "exclude": ["../python/loris_ephys_chunker/protocol_buffers"], "typeCheckingMode": "off", "reportDeprecated": "warning", "reportAbstractUsage": "error",