diff --git a/setup.py b/setup.py index 5018ad7..f8e8892 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from pathlib import Path -from setuptools import setup, find_packages + +from setuptools import find_packages, setup requirements_file_path = Path(__file__).parent / "requirements.txt" with open(requirements_file_path) as file: diff --git a/src/jazayeri_lab_to_nwb/watters/__init__.py b/src/jazayeri_lab_to_nwb/watters/__init__.py index 880f32a..4e94968 100644 --- a/src/jazayeri_lab_to_nwb/watters/__init__.py +++ b/src/jazayeri_lab_to_nwb/watters/__init__.py @@ -1,4 +1,7 @@ -from .wattersbehaviorinterface import WattersEyePositionInterface, WattersPupilSizeInterface -from .watterstrialsinterface import WattersTrialsInterface -from .wattersrecordinginterface import WattersDatRecordingInterface +from .wattersbehaviorinterface import ( + WattersEyePositionInterface, + WattersPupilSizeInterface, +) from .wattersnwbconverter import WattersNWBConverter +from .wattersrecordinginterface import WattersDatRecordingInterface +from .watterstrialsinterface import WattersTrialsInterface diff --git a/src/jazayeri_lab_to_nwb/watters/watters_convert_session.py b/src/jazayeri_lab_to_nwb/watters/watters_convert_session.py index d7c1072..e5e26aa 100644 --- a/src/jazayeri_lab_to_nwb/watters/watters_convert_session.py +++ b/src/jazayeri_lab_to_nwb/watters/watters_convert_session.py @@ -1,16 +1,16 @@ """Primary script to run to convert an entire session for of data using the NWBConverter.""" -import os import datetime import glob import json import logging +import os from pathlib import Path from typing import Union from uuid import uuid4 from zoneinfo import ZoneInfo from neuroconv.tools.data_transfers import automatic_dandi_upload -from neuroconv.utils import load_dict_from_file, dict_deep_update +from neuroconv.utils import dict_deep_update, load_dict_from_file from jazayeri_lab_to_nwb.watters import WattersNWBConverter @@ -64,6 +64,7 @@ def session_to_nwb( """ if dandiset_id is not None: import dandi # check importability + assert os.getenv("DANDI_API_KEY"), ( "Unable to find environment variable 'DANDI_API_KEY'. " "Please retrieve your token from DANDI and set this environment variable." @@ -249,5 +250,5 @@ def session_to_nwb( output_dir_path=output_dir_path, stub_test=stub_test, overwrite=overwrite, - # dandiset_id = "000620", + # dandiset_id = "000620", ) diff --git a/src/jazayeri_lab_to_nwb/watters/wattersbehaviorinterface.py b/src/jazayeri_lab_to_nwb/watters/wattersbehaviorinterface.py index 180e052..c4a0862 100644 --- a/src/jazayeri_lab_to_nwb/watters/wattersbehaviorinterface.py +++ b/src/jazayeri_lab_to_nwb/watters/wattersbehaviorinterface.py @@ -1,13 +1,13 @@ """Primary classes for converting experiment-specific behavior.""" -import numpy as np from pathlib import Path -from pynwb import NWBFile, TimeSeries -from pynwb.behavior import SpatialSeries -from hdmf.backends.hdf5 import H5DataIO +import numpy as np +from hdmf.backends.hdf5 import H5DataIO from neuroconv.basetemporalalignmentinterface import BaseTemporalAlignmentInterface -from neuroconv.utils import DeepDict, FolderPathType, FilePathType from neuroconv.tools.nwb_helpers import get_module +from neuroconv.utils import DeepDict, FilePathType, FolderPathType +from pynwb import NWBFile, TimeSeries +from pynwb.behavior import SpatialSeries class NumpyTemporalAlignmentMixin: diff --git a/src/jazayeri_lab_to_nwb/watters/wattersnwbconverter.py b/src/jazayeri_lab_to_nwb/watters/wattersnwbconverter.py index 96267b7..00ac42e 100644 --- a/src/jazayeri_lab_to_nwb/watters/wattersnwbconverter.py +++ b/src/jazayeri_lab_to_nwb/watters/wattersnwbconverter.py @@ -1,21 +1,24 @@ """Primary NWBConverter class for this dataset.""" import json import logging -import numpy as np -from typing import Optional from pathlib import Path +from typing import Optional +import numpy as np from neuroconv import NWBConverter -from neuroconv.utils import FolderPathType +from neuroconv.basetemporalalignmentinterface import BaseTemporalAlignmentInterface from neuroconv.datainterfaces import ( - SpikeGLXRecordingInterface, KiloSortSortingInterface, + SpikeGLXRecordingInterface, +) +from neuroconv.datainterfaces.ecephys.baserecordingextractorinterface import ( + BaseRecordingExtractorInterface, +) +from neuroconv.datainterfaces.ecephys.basesortingextractorinterface import ( + BaseSortingExtractorInterface, ) -from neuroconv.datainterfaces.ecephys.baserecordingextractorinterface import BaseRecordingExtractorInterface -from neuroconv.datainterfaces.ecephys.basesortingextractorinterface import BaseSortingExtractorInterface -from neuroconv.basetemporalalignmentinterface import BaseTemporalAlignmentInterface from neuroconv.datainterfaces.text.timeintervalsinterface import TimeIntervalsInterface - +from neuroconv.utils import FolderPathType from spikeinterface.core.waveform_tools import has_exceeding_spikes from spikeinterface.curation import remove_excess_spikes diff --git a/src/jazayeri_lab_to_nwb/watters/wattersrecordinginterface.py b/src/jazayeri_lab_to_nwb/watters/wattersrecordinginterface.py index 2302287..5e7159c 100644 --- a/src/jazayeri_lab_to_nwb/watters/wattersrecordinginterface.py +++ b/src/jazayeri_lab_to_nwb/watters/wattersrecordinginterface.py @@ -1,15 +1,16 @@ """Primary class for Watters Plexon probe data.""" -import os import json -import numpy as np -from pynwb import NWBFile +import os from pathlib import Path from typing import Optional, Union -from neuroconv.datainterfaces.ecephys.baserecordingextractorinterface import BaseRecordingExtractorInterface -from neuroconv.utils import FilePathType - +import numpy as np import probeinterface as pi +from neuroconv.datainterfaces.ecephys.baserecordingextractorinterface import ( + BaseRecordingExtractorInterface, +) +from neuroconv.utils import FilePathType +from pynwb import NWBFile from spikeinterface import BaseRecording @@ -78,7 +79,6 @@ def __init__( values=[probe_name] * len(self.recording_extractor.channel_ids), ) - def get_metadata(self) -> dict: metadata = super().get_metadata() metadata["Ecephys"]["Device"] = [ diff --git a/src/jazayeri_lab_to_nwb/watters/watterstrialsinterface.py b/src/jazayeri_lab_to_nwb/watters/watterstrialsinterface.py index fe13f50..79ca06c 100644 --- a/src/jazayeri_lab_to_nwb/watters/watterstrialsinterface.py +++ b/src/jazayeri_lab_to_nwb/watters/watterstrialsinterface.py @@ -1,14 +1,14 @@ """Primary class for converting experiment-specific behavior.""" import json -import numpy as np -import pandas as pd import warnings from pathlib import Path -from pynwb import NWBFile from typing import Optional +import numpy as np +import pandas as pd from neuroconv.datainterfaces.text.timeintervalsinterface import TimeIntervalsInterface -from neuroconv.utils import DeepDict, FolderPathType, FilePathType +from neuroconv.utils import DeepDict, FilePathType, FolderPathType +from pynwb import NWBFile class WattersTrialsInterface(TimeIntervalsInterface):