From e4550a16663002724329aaf36cbbbfd1d5125983 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Sun, 12 May 2024 07:28:09 -0600 Subject: [PATCH 1/4] add safeguard for probeinterface --- src/spikeinterface/extractors/neoextractors/spikegadgets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/spikeinterface/extractors/neoextractors/spikegadgets.py b/src/spikeinterface/extractors/neoextractors/spikegadgets.py index e835edf961..e4cb8325fe 100644 --- a/src/spikeinterface/extractors/neoextractors/spikegadgets.py +++ b/src/spikeinterface/extractors/neoextractors/spikegadgets.py @@ -38,7 +38,10 @@ 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 + # If version of probeinterface is larger than 0.2.21 then try this method + if probeinterface.__version__ > "0.2.21": + probegroup = probeinterface.read_spikegadgets(file_path, raise_error=False) if probegroup is not None: self.set_probes(probegroup, in_place=True) From f8040fbec4ca68e9200aa693ad2cde3d5631b727 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Mon, 13 May 2024 11:31:51 -0600 Subject: [PATCH 2/4] use packaging instead of ad-hoc parsing --- pyproject.toml | 1 + .../extractors/neoextractors/spikegadgets.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8fc4c449f7..42c96c9252 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,7 @@ dependencies = [ "zarr>=0.2.16", "neo>=0.13.0", "probeinterface>=0.2.21", + "packaging", ] [build-system] diff --git a/src/spikeinterface/extractors/neoextractors/spikegadgets.py b/src/spikeinterface/extractors/neoextractors/spikegadgets.py index e4cb8325fe..7d6b492325 100644 --- a/src/spikeinterface/extractors/neoextractors/spikegadgets.py +++ b/src/spikeinterface/extractors/neoextractors/spikegadgets.py @@ -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 @@ -38,9 +39,8 @@ 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 = None - # If version of probeinterface is larger than 0.2.21 then try this method - if probeinterface.__version__ > "0.2.21": + 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: From 517818ded4e21a51909eab7db300c21e8d68c8cf Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 14 May 2024 14:47:38 +0200 Subject: [PATCH 3/4] Force zarr<0.2.18 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 42c96c9252..a05e7201f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "numpy", "threadpoolctl>=3.0.0", "tqdm", - "zarr>=0.2.16", + "zarr>=0.2.16,<0.2.18", "neo>=0.13.0", "probeinterface>=0.2.21", "packaging", From a7a00db7aacc0730a73ed845d4eaafa1009e679b Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Tue, 14 May 2024 15:02:29 +0200 Subject: [PATCH 4/4] Fix wrong zarr version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a05e7201f0..cb71bb499b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "numpy", "threadpoolctl>=3.0.0", "tqdm", - "zarr>=0.2.16,<0.2.18", + "zarr>=2.16,<2.18", "neo>=0.13.0", "probeinterface>=0.2.21", "packaging",