@@ -9,8 +9,8 @@ def lab_to_nwb_dict(lab_key):
99 """
1010 lab_info = (lab .Lab & lab_key ).fetch1 ()
1111 return dict (
12- institution = lab_info .get (' institution' ),
13- lab = lab_info .get (' lab_name' ),
12+ institution = lab_info .get (" institution" ),
13+ lab = lab_info .get (" lab_name" ),
1414 )
1515
1616
@@ -23,11 +23,13 @@ def project_to_nwb_dict(project_key):
2323 """
2424 project_info = (lab .Project & project_key ).fetch1 ()
2525 return dict (
26- experiment_description = project_info .get ('project_description' ),
27- keywords = (lab .ProjectKeywords () & project_key
28- ).fetch ('keyword' ).tolist () or None ,
29- related_publications = (lab .ProjectPublication () & project_key
30- ).fetch ('publication' ).tolist () or None
26+ experiment_description = project_info .get ("project_description" ),
27+ keywords = (lab .ProjectKeywords () & project_key ).fetch ("keyword" ).tolist ()
28+ or None ,
29+ related_publications = (lab .ProjectPublication () & project_key )
30+ .fetch ("publication" )
31+ .tolist ()
32+ or None ,
3133 )
3234
3335
@@ -39,8 +41,8 @@ def protocol_to_nwb_dict(protocol_key):
3941 """
4042 protocol_info = (lab .Protocol & protocol_key ).fetch1 ()
4143 return dict (
42- protocol = protocol_info .get (' protocol' ),
43- notes = protocol_info .get (' protocol_description' )
44+ protocol = protocol_info .get (" protocol" ),
45+ notes = protocol_info .get (" protocol_description" ),
4446 )
4547
4648
@@ -63,15 +65,17 @@ def element_lab_to_nwb_dict(lab_key=None, project_key=None, protocol_key=None):
6365 :return: dictionary with NWB parameters
6466 """
6567 # Validate input
66- assert any ([lab_key , project_key , protocol_key ]), 'Must specify one key.'
67- assert lab_key is None or len (lab .Lab & lab_key ) == 1 , \
68- 'Multiple labs error! The lab_key should specify only one lab.'
69- assert project_key is None or len (lab .Project & project_key ) == 1 , \
70- 'Multiple projects error! The project_key should specify only one ' \
71- 'project.'
72- assert protocol_key is None or len (lab .Protocol & protocol_key ) == 1 , \
73- 'Multiple protocols error! The protocol_key should specify only one ' \
74- 'protocol.'
68+ assert any ([lab_key , project_key , protocol_key ]), "Must specify one key."
69+ assert (
70+ lab_key is None or len (lab .Lab & lab_key ) == 1
71+ ), "Multiple labs error! The lab_key should specify only one lab."
72+ assert project_key is None or len (lab .Project & project_key ) == 1 , (
73+ "Multiple projects error! The project_key should specify only one " "project."
74+ )
75+ assert protocol_key is None or len (lab .Protocol & protocol_key ) == 1 , (
76+ "Multiple protocols error! The protocol_key should specify only one "
77+ "protocol."
78+ )
7579
7680 element_info = dict ()
7781 if lab_key :
0 commit comments