From 8426387f666c0b981eaac9bcf5261ef9ca1dd68c Mon Sep 17 00:00:00 2001 From: Tom Donoghue Date: Sun, 7 Sep 2025 16:40:37 +0100 Subject: [PATCH 1/2] hdf5 -> h5 --- doc/api.rst | 2 +- hsntools/io/{hdf5.py => h5.py} | 5 ++++- hsntools/io/sorting.py | 2 +- hsntools/tests/conftest.py | 2 +- hsntools/tests/io/{test_hdf5.py => test_h5.py} | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) rename hsntools/io/{hdf5.py => h5.py} (96%) rename hsntools/tests/io/{test_hdf5.py => test_h5.py} (95%) diff --git a/doc/api.rst b/doc/api.rst index 38287a1..1768538 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -32,7 +32,7 @@ NWB file I/O HDF5 file I/O ~~~~~~~~~~~~~ -.. currentmodule:: hsntools.io.hdf5 +.. currentmodule:: hsntools.io.h5 .. autosummary:: :toctree: generated/ diff --git a/hsntools/io/hdf5.py b/hsntools/io/h5.py similarity index 96% rename from hsntools/io/hdf5.py rename to hsntools/io/h5.py index 0d14bee..ea09ea9 100644 --- a/hsntools/io/hdf5.py +++ b/hsntools/io/h5.py @@ -1,4 +1,7 @@ -"""File I/O for HDF5 files, including context managers.""" +"""File I/O for HDF5 files, including context managers. + +Functionality in this file requires the `h5py` module: https://github.com/h5py/h5py +""" from contextlib import contextmanager diff --git a/hsntools/io/sorting.py b/hsntools/io/sorting.py index 2d7c56c..b95966b 100644 --- a/hsntools/io/sorting.py +++ b/hsntools/io/sorting.py @@ -3,7 +3,7 @@ from pathlib import Path from hsntools.io.utils import get_files -from hsntools.io.hdf5 import open_h5file, save_to_h5file, load_from_h5file +from hsntools.io.h5 import open_h5file, save_to_h5file, load_from_h5file ################################################################################################### ################################################################################################### diff --git a/hsntools/tests/conftest.py b/hsntools/tests/conftest.py index b722dd9..8a02892 100644 --- a/hsntools/tests/conftest.py +++ b/hsntools/tests/conftest.py @@ -11,7 +11,7 @@ import pytest -from hsntools.io.hdf5 import open_h5file +from hsntools.io.h5 import open_h5file from hsntools.objects.task import TaskBase from hsntools.objects.electrodes import Bundle, Electrodes from hsntools.tests.tsettings import BASE_TEST_OUTPUTS_PATH, TEST_PATHS, TEST_SORT diff --git a/hsntools/tests/io/test_hdf5.py b/hsntools/tests/io/test_h5.py similarity index 95% rename from hsntools/tests/io/test_hdf5.py rename to hsntools/tests/io/test_h5.py index a32c904..6724309 100644 --- a/hsntools/tests/io/test_hdf5.py +++ b/hsntools/tests/io/test_h5.py @@ -1,4 +1,4 @@ -"""Tests for hsntools.io.hdf5""" +"""Tests for hsntools.io.h5""" import os @@ -6,7 +6,7 @@ from hsntools.tests.tsettings import TEST_FILE_PATH -from hsntools.io.hdf5 import * +from hsntools.io.h5 import * ################################################################################################### ################################################################################################### From a5910888eb3e94b41fd32d9848911fc6cf93f856 Mon Sep 17 00:00:00 2001 From: Tom Donoghue Date: Sun, 7 Sep 2025 16:43:04 +0100 Subject: [PATCH 2/2] update docstrings for optional reqs --- hsntools/io/nsp.py | 5 ++++- hsntools/io/nwb.py | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/hsntools/io/nsp.py b/hsntools/io/nsp.py index 6300f39..16bd5be 100644 --- a/hsntools/io/nsp.py +++ b/hsntools/io/nsp.py @@ -1,4 +1,7 @@ -"""Neural Signal Processor (NSP) related I/O functions.""" +"""Neural Signal Processor (NSP) related I/O functions. + +Functionality in this file requires the `neo` module: https://github.com/NeuralEnsemble/python-neo +""" from hsntools.io.utils import check_folder from hsntools.modutils.dependencies import safe_import, check_dependency diff --git a/hsntools/io/nwb.py b/hsntools/io/nwb.py index fca83a2..67e359e 100644 --- a/hsntools/io/nwb.py +++ b/hsntools/io/nwb.py @@ -1,4 +1,8 @@ -"""Helper utilities for validating NWB files.""" +"""Helper utilities for validating NWB files. + +Functionality in this file requires the `pynwb` module: +https://github.com/NeurodataWithoutBorders/pynwb +""" from hsntools.io.utils import check_ext, check_folder, make_session_name from hsntools.modutils.dependencies import safe_import, check_dependency