Skip to content

Commit c2d9f47

Browse files
authored
safeguard in creating/inserting probe types upon probe activation
1 parent 9ec904f commit c2d9f47

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

element_array_ephys/probe.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ def activate(
3737
"neuropixels 2.0 - SS",
3838
"neuropixels 2.0 - MS",
3939
):
40-
ProbeType.create_neuropixels_probe(probe_type)
40+
if not (ProbeType & {'probe_type': probe_type}):
41+
try:
42+
ProbeType.create_neuropixels_probe(probe_type)
43+
except dj.errors.DataJointError as e:
44+
print(f'Unable to create probe-type: {probe_type}\n{str(e)}')
4145

4246

4347
@schema

0 commit comments

Comments
 (0)