diff --git a/.github/workflows/deploy_tests_on_pull_request.yml b/.github/workflows/deploy_tests_on_pull_request.yml index 9453950..817b20c 100644 --- a/.github/workflows/deploy_tests_on_pull_request.yml +++ b/.github/workflows/deploy_tests_on_pull_request.yml @@ -9,4 +9,4 @@ concurrency: # Cancel previous workflows on the same pull request jobs: TestInstallation: - uses: ./.github/workflows/installation.yml + uses: ./.github/workflows/test_installation.yml diff --git a/.github/workflows/installation.yml b/.github/workflows/test_installation.yml similarity index 84% rename from .github/workflows/installation.yml rename to .github/workflows/test_installation.yml index fec1a94..e5bf72d 100644 --- a/.github/workflows/installation.yml +++ b/.github/workflows/test_installation.yml @@ -35,5 +35,8 @@ jobs: - name: Test import run: python -c "import ibl_to_nwb" - - name: Test import - run: python -c "import ibl_to_nwb.brainwide_map" + - name: Test data interface imports + run: python -c "import ibl_to_nwb.datainterfaces" + + - name: Test converters imports + run: python -c "import ibl_to_nwb.converters" diff --git a/pyproject.toml b/pyproject.toml index d292583..151d7ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,8 @@ license = {file = "license.txt"} requires-python = ">=3.9" dependencies = [ "neuroconv", + "spikeinterface", + "probeinterface", "ndx-pose>=0.1.1", "ndx-ibl==0.1.0", "ONE-api", diff --git a/src/ibl_to_nwb/brainwide_map/initial_conversion_environment.txt b/src/ibl_to_nwb/_environments/initial_conversion_environment.txt similarity index 100% rename from src/ibl_to_nwb/brainwide_map/initial_conversion_environment.txt rename to src/ibl_to_nwb/_environments/initial_conversion_environment.txt diff --git a/src/__init__.py b/src/ibl_to_nwb/_metadata/__init__.py similarity index 100% rename from src/__init__.py rename to src/ibl_to_nwb/_metadata/__init__.py diff --git a/src/ibl_to_nwb/brainwide_map/brainwide_map_metadata.yml b/src/ibl_to_nwb/_metadata/brainwide_map_general.yml similarity index 100% rename from src/ibl_to_nwb/brainwide_map/brainwide_map_metadata.yml rename to src/ibl_to_nwb/_metadata/brainwide_map_general.yml diff --git a/src/ibl_to_nwb/metadata/ecephys.yml b/src/ibl_to_nwb/_metadata/ecephys.yml similarity index 100% rename from src/ibl_to_nwb/metadata/ecephys.yml rename to src/ibl_to_nwb/_metadata/ecephys.yml diff --git a/src/ibl_to_nwb/metadata/pupils.yml b/src/ibl_to_nwb/_metadata/pupils.yml similarity index 100% rename from src/ibl_to_nwb/metadata/pupils.yml rename to src/ibl_to_nwb/_metadata/pupils.yml diff --git a/src/ibl_to_nwb/brainwide_map/metadata/trials.yml b/src/ibl_to_nwb/_metadata/trials.yml similarity index 100% rename from src/ibl_to_nwb/brainwide_map/metadata/trials.yml rename to src/ibl_to_nwb/_metadata/trials.yml diff --git a/src/ibl_to_nwb/metadata/wheel.yml b/src/ibl_to_nwb/_metadata/wheel.yml similarity index 100% rename from src/ibl_to_nwb/metadata/wheel.yml rename to src/ibl_to_nwb/_metadata/wheel.yml diff --git a/src/ibl_to_nwb/brainwide_map/metadata/__init__.py b/src/ibl_to_nwb/_scripts/__init__.py similarity index 100% rename from src/ibl_to_nwb/brainwide_map/metadata/__init__.py rename to src/ibl_to_nwb/_scripts/__init__.py diff --git a/src/ibl_to_nwb/brainwide_map/convert_brainwide_map.py b/src/ibl_to_nwb/_scripts/convert_brainwide_map.py similarity index 100% rename from src/ibl_to_nwb/brainwide_map/convert_brainwide_map.py rename to src/ibl_to_nwb/_scripts/convert_brainwide_map.py diff --git a/src/ibl_to_nwb/brainwide_map/convert_brainwide_map_parallel.py b/src/ibl_to_nwb/_scripts/convert_brainwide_map_parallel.py similarity index 100% rename from src/ibl_to_nwb/brainwide_map/convert_brainwide_map_parallel.py rename to src/ibl_to_nwb/_scripts/convert_brainwide_map_parallel.py diff --git a/src/ibl_to_nwb/brainwide_map/convert_brainwide_map_processed_only.py b/src/ibl_to_nwb/_scripts/convert_brainwide_map_processed_only.py similarity index 100% rename from src/ibl_to_nwb/brainwide_map/convert_brainwide_map_processed_only.py rename to src/ibl_to_nwb/_scripts/convert_brainwide_map_processed_only.py diff --git a/src/ibl_to_nwb/brainwide_map/convert_brainwide_map_processed_only_local_testing.py b/src/ibl_to_nwb/_scripts/convert_brainwide_map_processed_only_local_testing.py similarity index 100% rename from src/ibl_to_nwb/brainwide_map/convert_brainwide_map_processed_only_local_testing.py rename to src/ibl_to_nwb/_scripts/convert_brainwide_map_processed_only_local_testing.py diff --git a/src/ibl_to_nwb/brainwide_map/convert_brainwide_map_processed_only_parallel.py b/src/ibl_to_nwb/_scripts/convert_brainwide_map_processed_only_parallel.py similarity index 100% rename from src/ibl_to_nwb/brainwide_map/convert_brainwide_map_processed_only_parallel.py rename to src/ibl_to_nwb/_scripts/convert_brainwide_map_processed_only_parallel.py diff --git a/src/ibl_to_nwb/brainwide_map/convert_brainwide_map_raw_only_parallel.py b/src/ibl_to_nwb/_scripts/convert_brainwide_map_raw_only_parallel.py similarity index 100% rename from src/ibl_to_nwb/brainwide_map/convert_brainwide_map_raw_only_parallel.py rename to src/ibl_to_nwb/_scripts/convert_brainwide_map_raw_only_parallel.py diff --git a/src/ibl_to_nwb/brainwide_map/__init__.py b/src/ibl_to_nwb/brainwide_map/__init__.py deleted file mode 100644 index 624495d..0000000 --- a/src/ibl_to_nwb/brainwide_map/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .brainwidemapconverter import BrainwideMapConverter diff --git a/src/ibl_to_nwb/brainwide_map/datainterfaces/__init__.py b/src/ibl_to_nwb/brainwide_map/datainterfaces/__init__.py deleted file mode 100644 index 35c45ea..0000000 --- a/src/ibl_to_nwb/brainwide_map/datainterfaces/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .brainwidemaptrialsinterface import BrainwideMapTrialsInterface diff --git a/src/ibl_to_nwb/converters/__init__.py b/src/ibl_to_nwb/converters/__init__.py new file mode 100644 index 0000000..936d87c --- /dev/null +++ b/src/ibl_to_nwb/converters/__init__.py @@ -0,0 +1,7 @@ +from ._brainwide_map_converter import BrainwideMapConverter +from ._iblconverter import IblConverter + +__all__ = [ + "BrainwideMapConverter", + "IblConverter", +] diff --git a/src/ibl_to_nwb/brainwide_map/brainwidemapconverter.py b/src/ibl_to_nwb/converters/_brainwide_map_converter.py similarity index 76% rename from src/ibl_to_nwb/brainwide_map/brainwidemapconverter.py rename to src/ibl_to_nwb/converters/_brainwide_map_converter.py index 6abdea2..7d78b5e 100644 --- a/src/ibl_to_nwb/brainwide_map/brainwidemapconverter.py +++ b/src/ibl_to_nwb/converters/_brainwide_map_converter.py @@ -2,14 +2,14 @@ from neuroconv.utils import dict_deep_update, load_dict_from_file -from ..iblconverter import IblConverter +from src.ibl_to_nwb.converters._iblconverter import IblConverter class BrainwideMapConverter(IblConverter): def get_metadata(self) -> dict: metadata = super().get_metadata() - experiment_metadata = load_dict_from_file(file_path=Path(__file__).parent / "brainwide_map_metadata.yml") + experiment_metadata = load_dict_from_file(file_path=Path(__file__).parent / "brainwide_map_general.yml") metadata = dict_deep_update(metadata, experiment_metadata) return metadata diff --git a/src/ibl_to_nwb/iblconverter.py b/src/ibl_to_nwb/converters/_iblconverter.py similarity index 100% rename from src/ibl_to_nwb/iblconverter.py rename to src/ibl_to_nwb/converters/_iblconverter.py diff --git a/src/ibl_to_nwb/datainterfaces/__init__.py b/src/ibl_to_nwb/datainterfaces/__init__.py index d2370f4..461e6cb 100644 --- a/src/ibl_to_nwb/datainterfaces/__init__.py +++ b/src/ibl_to_nwb/datainterfaces/__init__.py @@ -1,8 +1,20 @@ -from .iblposeestimationinterface import IblPoseEstimationInterface -from .iblsortingextractor import IblSortingExtractor -from .iblsortinginterface import IblSortingInterface -from .iblstreaminginterface import IblStreamingApInterface, IblStreamingLfInterface -from .lickinterface import LickInterface -from .pupiltrackinginterface import PupilTrackingInterface -from .roimotionenergyinterface import RoiMotionEnergyInterface -from .wheelinterface import WheelInterface +from ._pose_estimation import IblPoseEstimationInterface +from ._ibl_sorting_extractor import IblSortingExtractor +from ._ibl_sorting_interface import IblSortingInterface +from ._ibl_streaming_interface import IblStreamingApInterface, IblStreamingLfInterface +from ._lick_times import LickInterface +from ._pupil_tracking import PupilTrackingInterface +from ._roi_motion_energy import RoiMotionEnergyInterface +from ._wheel_movement import WheelInterface + +__all__ = [ + "IblPoseEstimationInterface", + "IblSortingExtractor", + "IblSortingInterface", + "IblStreamingApInterface", + "IblStreamingLfInterface", + "LickInterface", + "PupilTrackingInterface", + "RoiMotionEnergyInterface", + "WheelInterface", +] diff --git a/src/ibl_to_nwb/brainwide_map/datainterfaces/brainwidemaptrialsinterface.py b/src/ibl_to_nwb/datainterfaces/_brainwide_map_trials.py similarity index 98% rename from src/ibl_to_nwb/brainwide_map/datainterfaces/brainwidemaptrialsinterface.py rename to src/ibl_to_nwb/datainterfaces/_brainwide_map_trials.py index 3a30043..7772c5d 100644 --- a/src/ibl_to_nwb/brainwide_map/datainterfaces/brainwidemaptrialsinterface.py +++ b/src/ibl_to_nwb/datainterfaces/_brainwide_map_trials.py @@ -15,7 +15,7 @@ def __init__(self, one: ONE, session: str): def get_metadata(self) -> dict: metadata = super().get_metadata() - trial_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "metadata" / "trials.yml") + trial_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "_metadata" / "trials.yml") metadata.update(trial_metadata) return metadata diff --git a/src/ibl_to_nwb/datainterfaces/iblsortingextractor.py b/src/ibl_to_nwb/datainterfaces/_ibl_sorting_extractor.py similarity index 100% rename from src/ibl_to_nwb/datainterfaces/iblsortingextractor.py rename to src/ibl_to_nwb/datainterfaces/_ibl_sorting_extractor.py diff --git a/src/ibl_to_nwb/datainterfaces/iblsortinginterface.py b/src/ibl_to_nwb/datainterfaces/_ibl_sorting_interface.py similarity index 90% rename from src/ibl_to_nwb/datainterfaces/iblsortinginterface.py rename to src/ibl_to_nwb/datainterfaces/_ibl_sorting_interface.py index 9b1a08b..18c478f 100644 --- a/src/ibl_to_nwb/datainterfaces/iblsortinginterface.py +++ b/src/ibl_to_nwb/datainterfaces/_ibl_sorting_interface.py @@ -7,7 +7,7 @@ ) from neuroconv.utils import load_dict_from_file -from .iblsortingextractor import IblSortingExtractor +from ._ibl_sorting_extractor import IblSortingExtractor class IblSortingInterface(BaseSortingExtractorInterface): @@ -16,7 +16,7 @@ class IblSortingInterface(BaseSortingExtractorInterface): def get_metadata(self) -> dict: metadata = super().get_metadata() - ecephys_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "metadata" / "ecephys.yml") + ecephys_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "_metadata" / "ecephys.yml") metadata.update(Ecephys=dict()) metadata["Ecephys"].update(UnitProperties=ecephys_metadata["Ecephys"]["UnitProperties"]) diff --git a/src/ibl_to_nwb/datainterfaces/iblstreaminginterface.py b/src/ibl_to_nwb/datainterfaces/_ibl_streaming_interface.py similarity index 98% rename from src/ibl_to_nwb/datainterfaces/iblstreaminginterface.py rename to src/ibl_to_nwb/datainterfaces/_ibl_streaming_interface.py index 0f0a051..f8aac0b 100644 --- a/src/ibl_to_nwb/datainterfaces/iblstreaminginterface.py +++ b/src/ibl_to_nwb/datainterfaces/_ibl_streaming_interface.py @@ -104,7 +104,7 @@ def get_metadata_schema(self) -> dict: def get_metadata(self) -> dict: metadata = super().get_metadata() - ecephys_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "metadata" / "ecephys.yml") + ecephys_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "_metadata" / "ecephys.yml") metadata["Ecephys"].update({self.es_key: ecephys_metadata["Ecephys"]["ElectricalSeriesAp"]}) if len(self.available_streams) > 1: @@ -176,7 +176,7 @@ def get_metadata(self) -> dict: metadata = super().get_metadata() metadata["Ecephys"].pop("ElectrodeGroup") - ecephys_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "metadata" / "ecephys.yml") + ecephys_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "_metadata" / "ecephys.yml") metadata["Ecephys"].update({self.es_key: ecephys_metadata["Ecephys"]["ElectricalSeriesLf"]}) if len(self.available_streams) > 1: diff --git a/src/ibl_to_nwb/datainterfaces/lickinterface.py b/src/ibl_to_nwb/datainterfaces/_lick_times.py similarity index 100% rename from src/ibl_to_nwb/datainterfaces/lickinterface.py rename to src/ibl_to_nwb/datainterfaces/_lick_times.py diff --git a/src/ibl_to_nwb/datainterfaces/iblposeestimationinterface.py b/src/ibl_to_nwb/datainterfaces/_pose_estimation.py similarity index 100% rename from src/ibl_to_nwb/datainterfaces/iblposeestimationinterface.py rename to src/ibl_to_nwb/datainterfaces/_pose_estimation.py diff --git a/src/ibl_to_nwb/datainterfaces/pupiltrackinginterface.py b/src/ibl_to_nwb/datainterfaces/_pupil_tracking.py similarity index 97% rename from src/ibl_to_nwb/datainterfaces/pupiltrackinginterface.py rename to src/ibl_to_nwb/datainterfaces/_pupil_tracking.py index 7fd0e06..7a04add 100644 --- a/src/ibl_to_nwb/datainterfaces/pupiltrackinginterface.py +++ b/src/ibl_to_nwb/datainterfaces/_pupil_tracking.py @@ -20,7 +20,7 @@ def __init__(self, one: ONE, session: str, camera_name: str): def get_metadata(self) -> dict: metadata = super().get_metadata() - pupils_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "metadata" / "pupils.yml") + pupils_metadata = load_dict_from_file(file_path=Path(__file__).parent.parent / "_metadata" / "pupils.yml") metadata.update(pupils_metadata) return metadata diff --git a/src/ibl_to_nwb/datainterfaces/roimotionenergyinterface.py b/src/ibl_to_nwb/datainterfaces/_roi_motion_energy.py similarity index 100% rename from src/ibl_to_nwb/datainterfaces/roimotionenergyinterface.py rename to src/ibl_to_nwb/datainterfaces/_roi_motion_energy.py diff --git a/src/ibl_to_nwb/datainterfaces/wheelinterface.py b/src/ibl_to_nwb/datainterfaces/_wheel_movement.py similarity index 98% rename from src/ibl_to_nwb/datainterfaces/wheelinterface.py rename to src/ibl_to_nwb/datainterfaces/_wheel_movement.py index 4413e79..64f684d 100644 --- a/src/ibl_to_nwb/datainterfaces/wheelinterface.py +++ b/src/ibl_to_nwb/datainterfaces/_wheel_movement.py @@ -18,7 +18,7 @@ def __init__(self, one: ONE, session: str): def get_metadata(self) -> dict: metadata = super().get_metadata() - metadata.update(load_dict_from_file(file_path=Path(__file__).parent.parent / "metadata" / "wheel.yml")) + metadata.update(load_dict_from_file(file_path=Path(__file__).parent.parent / "_metadata" / "wheel.yml")) return metadata diff --git a/src/ibl_to_nwb/metadata/__init__.py b/src/ibl_to_nwb/metadata/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/ibl_to_nwb/requirements.txt b/src/ibl_to_nwb/requirements.txt deleted file mode 100644 index 3801602..0000000 --- a/src/ibl_to_nwb/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -neuroconv -spikeinterface>=0.97.0 # Actually need to use the streaming IBL fix for maximum efficiency -ONE-api>=1.16.3 -ibllib>=2.21.0 -ndx-pose>=0.1.1 -ndx-ibl==0.1.0 -probeinterface -iblatlas