Skip to content

Commit

Permalink
allow stimulus_description in ScalaNWBReader (#183)
Browse files Browse the repository at this point in the history
* allow stimulus_description in ScalaNWBReader

* lint fix

* edge case with no stimulus_description attribute[F

* adding AttributeError

* KeyError in ScalaNWBReader
  • Loading branch information
darshanmandge authored Jun 14, 2024
1 parent 57b7dc0 commit 348d3a8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bluepyefe/nwbreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,14 @@ def read(self):

for sweep in list(self.content['acquisition'].keys()):
key_current = sweep.replace('Series', 'StimulusSeries')
protocol_name = "Step"
try:
protocol_name = self.content["acquisition"][sweep].attrs["stimulus_description"]
except KeyError:
logger.warning(f'Could not find "stimulus_description" attribute for {sweep}, Setting it as "Step"')
protocol_name = "Step"

if ("na" == protocol_name.lower()) or ("step" in protocol_name.lower()):
protocol_name = "Step"

if (
self.target_protocols and
Expand Down

0 comments on commit 348d3a8

Please sign in to comment.