From 1b9ab3593c81f4b09b3a9249838e46fe623d2d64 Mon Sep 17 00:00:00 2001 From: Alessio Buccino Date: Mon, 30 Oct 2023 12:26:40 +0100 Subject: [PATCH] Remove try-except --- src/spikeinterface/extractors/neoextractors/openephys.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/spikeinterface/extractors/neoextractors/openephys.py b/src/spikeinterface/extractors/neoextractors/openephys.py index 99992c2c93..b9aa5d46d6 100644 --- a/src/spikeinterface/extractors/neoextractors/openephys.py +++ b/src/spikeinterface/extractors/neoextractors/openephys.py @@ -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