Skip to content

Commit

Permalink
Merge pull request #2051 from h-mayorquin/ibl_move_import_inside
Browse files Browse the repository at this point in the history
Move import to `__init__` in `CompressedBinaryIblExtractor`
  • Loading branch information
samuelgarcia authored Sep 29, 2023
2 parents 427d7b5 + c2d369a commit 243a30c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/spikeinterface/extractors/cbin_ibl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
from spikeinterface.extractors.neuropixels_utils import get_neuropixels_sample_shifts
from spikeinterface.core.core_tools import define_function_from_class

try:
import mtscomp

HAVE_MTSCOMP = True
except:
HAVE_MTSCOMP = False


class CompressedBinaryIblExtractor(BaseRecording):
"""Load IBL data as an extractor object.
Expand Down Expand Up @@ -42,7 +35,6 @@ class CompressedBinaryIblExtractor(BaseRecording):
"""

extractor_name = "CompressedBinaryIbl"
installed = HAVE_MTSCOMP
mode = "folder"
installation_mesg = "To use the CompressedBinaryIblExtractor, install mtscomp: \n\n pip install mtscomp\n\n"
name = "cbin_ibl"
Expand All @@ -51,7 +43,10 @@ def __init__(self, folder_path, load_sync_channel=False, stream_name="ap"):
# this work only for future neo
from neo.rawio.spikeglxrawio import read_meta_file, extract_stream_info

assert HAVE_MTSCOMP
try:
import mtscomp
except:
raise ImportError(self.installation_mesg)
folder_path = Path(folder_path)

# check bands
Expand Down

0 comments on commit 243a30c

Please sign in to comment.