Skip to content

Commit

Permalink
Merge pull request #2833 from h-mayorquin/add_safeguard_to_spikegadgets
Browse files Browse the repository at this point in the history
Add safeguard for probeinterface use of `read_spikegadgets`
  • Loading branch information
alejoe91 authored May 14, 2024
2 parents eb594f2 + a7a00db commit ec5925c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ dependencies = [
"numpy",
"threadpoolctl>=3.0.0",
"tqdm",
"zarr>=0.2.16",
"zarr>=2.16,<2.18",
"neo>=0.13.0",
"probeinterface>=0.2.21",
"packaging",
]

[build-system]
Expand Down
9 changes: 6 additions & 3 deletions src/spikeinterface/extractors/neoextractors/spikegadgets.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

from pathlib import Path

import probeinterface
import packaging

import packaging.version
import probeinterface
from spikeinterface.core.core_tools import define_function_from_class

from .neobaseextractor import NeoBaseRecordingExtractor
Expand Down Expand Up @@ -38,7 +39,9 @@ def __init__(self, file_path, stream_id=None, stream_name=None, block_index=None
)
self._kwargs.update(dict(file_path=str(Path(file_path).absolute()), stream_id=stream_id))

probegroup = probeinterface.read_spikegadgets(file_path, raise_error=False)
probegroup = None # TODO remove once probeinterface is updated to 0.2.22 in the pyproject.toml
if packaging.version.parse(probeinterface.__version__) > packaging.version.parse("0.2.21"):
probegroup = probeinterface.read_spikegadgets(file_path, raise_error=False)

if probegroup is not None:
self.set_probes(probegroup, in_place=True)
Expand Down

0 comments on commit ec5925c

Please sign in to comment.