From 2358b419e280b7c6d7f8aae9470b358aac07c90a Mon Sep 17 00:00:00 2001 From: Tanguy Pierre Louis Damart Date: Fri, 2 Sep 2022 13:20:48 +0200 Subject: [PATCH] Some bug fix --- bluepyefe/extract.py | 10 +++++----- bluepyefe/reader.py | 13 ++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/bluepyefe/extract.py b/bluepyefe/extract.py index c605b7c..c31c965 100644 --- a/bluepyefe/extract.py +++ b/bluepyefe/extract.py @@ -186,10 +186,10 @@ def read_recordings( def extract_efeatures_at_targets( - cells, - targets, - map_function=map, - efel_settings=None + cells, + targets, + map_function=map, + efel_settings=None ): """ Extract efeatures from recordings following the protocols, amplitudes and @@ -809,7 +809,7 @@ def extract_efeatures( the path contains data coming from different stimuli (eg: for NWB). targets (list): define the efeatures to extract as well as which protocols and current amplitude they should be extracted for. If - targets are not probided, automatic targets will be used. + targets are not provided, automatic targets will be used. Of the form: [{ "efeature": "AP_amplitude", diff --git a/bluepyefe/reader.py b/bluepyefe/reader.py index 6c83317..b7dea9f 100644 --- a/bluepyefe/reader.py +++ b/bluepyefe/reader.py @@ -269,9 +269,7 @@ def _nwb_reader_BBP(content, target_protocols, repetition): for cell_id in content["data_organization"].keys(): if ecode not in content["data_organization"][cell_id]: - logger.info( - f"No eCode {ecode} in nwb {in_data['filepath']}." - ) + logger.debug(f"No eCode {ecode} in nwb.") continue ecode_content = content["data_organization"][cell_id][ecode] @@ -292,6 +290,15 @@ def _nwb_reader_BBP(content, target_protocols, repetition): else: continue + if key_current not in content["stimulus"]["presentation"]: + logger.debug(f"Ignoring {key_current} not" + " present in the stimulus presentation") + continue + if trace_name not in content["acquisition"]: + logger.debug(f"Ignoring {trace_name} not" + " present in the acquisition") + continue + data.append(_format_nwb_trace( voltage=content["acquisition"][trace_name]["data"], current=content["stimulus"]["presentation"][key_current]["data"],