Skip to content

Commit 3aae31c

Browse files
committed
suggestions from review
1 parent d80f876 commit 3aae31c

File tree

1 file changed

+8
-22
lines changed

1 file changed

+8
-22
lines changed

src/trodes_to_nwb/convert_optogenetics.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,15 @@ def add_optogenetics(nwbfile: NWBFile, metadata: dict, device_metadata: List[dic
3232
List of dictionaries containing metadata for devices used in the experiment.
3333
"""
3434
logger = logging.getLogger("convert")
35+
necessary_metadata = [
36+
"virus_injection",
37+
"opto_excitation_source",
38+
"optical_fiber",
39+
"optogenetic_stimulation_software",
40+
]
41+
3542
if not (
36-
all(
37-
[
38-
x in metadata
39-
for x in [
40-
"virus_injection",
41-
"opto_excitation_source",
42-
"optical_fiber",
43-
"optogenetic_stimulation_software",
44-
]
45-
]
46-
)
47-
and all(
48-
[
49-
len(metadata[x]) > 0
50-
for x in [
51-
"virus_injection",
52-
"opto_excitation_source",
53-
"optical_fiber",
54-
"optogenetic_stimulation_software",
55-
]
56-
]
57-
)
43+
all([((x in metadata) and len(metadata[x]) > 0) for x in necessary_metadata])
5844
):
5945
logger.info("No available optogenetic metadata")
6046
return

0 commit comments

Comments
 (0)