Skip to content

Commit 96c57f7

Browse files
committed
fix nwbfile_kwargs logic
1 parent 365b43b commit 96c57f7

File tree

1 file changed

+17
-13
lines changed
  • element_array_ephys/export/nwb

1 file changed

+17
-13
lines changed

element_array_ephys/export/nwb/nwb.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
from uuid import uuid4
1717

1818
from ... import ephys
19-
#from workflow.pipeline import ephys
19+
20+
# from workflow.pipeline import ephys
2021

2122

2223
class DecimalEncoder(json.JSONEncoder):
@@ -500,16 +501,16 @@ def add_ephys_lfp_from_source_to_nwb(
500501

501502

502503
def ecephys_session_to_nwb(
503-
session_key,
504-
subject_id=None,
505-
raw=True,
506-
spikes=True,
507-
lfp="source",
508-
end_frame=None,
509-
lab_key=None,
510-
project_key=None,
511-
protocol_key=None,
512-
nwbfile_kwargs=None,
504+
session_key,
505+
subject_id=None,
506+
raw=True,
507+
spikes=True,
508+
lfp="source",
509+
end_frame=None,
510+
lab_key=None,
511+
project_key=None,
512+
protocol_key=None,
513+
nwbfile_kwargs=None,
513514
):
514515
"""
515516
Main function for converting ephys data to NWB
@@ -548,7 +549,11 @@ def ecephys_session_to_nwb(
548549
additional_nwbfile_kwargs=nwbfile_kwargs,
549550
)
550551
else:
551-
if not isinstance(nwbfile_kwargs, dict) and {'session_description', 'identifier', 'session_start_time'}.issubset(nwbfile_kwargs):
552+
if isinstance(nwbfile_kwargs, dict) and not {
553+
"session_description",
554+
"identifier",
555+
"session_start_time",
556+
}.issubset(nwbfile_kwargs):
552557
raise ValueError(
553558
"If element-session is not activated, you must include nwbfile_kwargs as a dictionary."
554559
"Required fields are 'session_description' (str), 'identifier' (str), and 'session_start_time' (datetime)"
@@ -570,7 +575,6 @@ def ecephys_session_to_nwb(
570575
return nwbfile
571576

572577

573-
574578
def write_nwb(nwbfile, fname, check_read=True):
575579
"""
576580
Export NWBFile

0 commit comments

Comments
 (0)