diff --git a/bluepyefe/extract.py b/bluepyefe/extract.py index 494ccf2..9659aa4 100644 --- a/bluepyefe/extract.py +++ b/bluepyefe/extract.py @@ -451,22 +451,28 @@ def group_efeatures( efel_settings=efel_settings, ) + missing_protocols = set() + for protocol in protocols: + found = False for cell in cells: - if cell.rheobase is None and not absolute_amplitude: continue + recordings = cell.get_recordings_by_protocol_name(protocol.name) + if not recordings: + continue + found = True - for recording in cell.get_recordings_by_protocol_name( - protocol.name - ): - - if recording.in_target( - protocol.amplitude, - protocol.tolerance, - absolute_amplitude - ): + for recording in recordings: + if recording.in_target(protocol.amplitude, + protocol.tolerance, + absolute_amplitude): protocol.append(recording) + if not found: + missing_protocols.add(protocol.name) + + for name in missing_protocols: + logger.warning(f"Protocol '{name}' not found in any cell recordings.") return protocols diff --git a/bluepyefe/nwbreader.py b/bluepyefe/nwbreader.py index 63034fb..2a8ed8c 100644 --- a/bluepyefe/nwbreader.py +++ b/bluepyefe/nwbreader.py @@ -277,6 +277,16 @@ def read(self): data (list of dict): list of traces """ data = [] + + # Only return data if target_protocols is None or includes "step" + if self.target_protocols: + allowed = [p.lower() for p in self.target_protocols] + if "step" not in allowed: + logger.warning( + f"TRTNWBReader only supports 'step' protocols, but requested: {self.target_protocols}. Skipping." + ) + return [] + # possible paths in content: # /acquisition/index_00 # or /acquisition/index_000