Skip to content

Commit 4947df7

Browse files
committed
Check if metatdata is None
1 parent c98968b commit 4947df7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/trodes_to_nwb/convert_ephys.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def add_raw_ephys(
355355
electrode_row_indices : list
356356
which electrodes to add to table
357357
metadata : dict, optional
358-
metadata dictionary, useed only for conversion if not in rec, by default None
358+
metadata dictionary, used only for conversion if not in rec, by default None
359359
"""
360360

361361
electrode_table_region = nwbfile.create_electrode_table_region(
@@ -377,10 +377,13 @@ def add_raw_ephys(
377377
) # Use metadata-provided conversion if not available in rec file
378378

379379
# read metadata
380-
if "save_as_microvolts" in metadata:
381-
save_as_microvolts = metadata["save_as_microvolts"]
382-
else:
380+
if metadata is None:
383381
save_as_microvolts = True
382+
else:
383+
if "save_as_microvolts" in metadata:
384+
save_as_microvolts = metadata["save_as_microvolts"]
385+
else:
386+
save_as_microvolts = True
384387

385388
# make the data iterator
386389
rec_dci = RecFileDataChunkIterator(

0 commit comments

Comments
 (0)