Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add safeguard for probeinterface use of read_spikegadgets #2833

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/spikeinterface/extractors/neoextractors/spikegadgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@h-mayorquin let's use packaging:

from packaging.version import parse
        if parse(probeinterface.__version__) > parse("0.2.21"):

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you fine with adding packacing as a dependency?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, added.

probegroup = probeinterface.read_spikegadgets(file_path, raise_error=False)

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