Skip to content

Commit

Permalink
Remove try-except
Browse files Browse the repository at this point in the history
  • Loading branch information
alejoe91 committed Oct 30, 2023
1 parent 9a37e57 commit 1b9ab35
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/spikeinterface/extractors/neoextractors/openephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,11 @@ def __init__(
else:
self.set_probe(probe, in_place=True)

# this try-except handles a breaking change in probeinterface after v0.2.18
# in the new version, the Neuropixels model name is stored in the "model_name" attribute,
# this handles a breaking change in probeinterface after v0.2.18
# in the new version, the Neuropixels model name is stored in the "model_name" annotation,
# rather than in the "probe_name" annotation
try:
model_name = probe.model_name
except Exception as e:
model_name = probe.annotations.get("model_name", None)
if model_name is None:
model_name = probe.annotations["probe_name"]

# load num_channels_per_adc depending on probe type
Expand Down

0 comments on commit 1b9ab35

Please sign in to comment.