2222)
2323from aind_data_schema .models .modalities import Modality
2424from aind_data_schema .models .organizations import Organization
25+ from aind_data_schema .models .pid_names import PIDName
2526from aind_data_schema .models .platforms import Platform
2627
2728DATA_DESCRIPTION_FILES_PATH = Path (__file__ ).parent / "resources" / "ephys_data_description"
@@ -60,7 +61,7 @@ def test_constructors(self):
6061 modality = [Modality .ECEPHYS ],
6162 platform = Platform .ECEPHYS ,
6263 subject_id = "12345" ,
63- investigators = ["Jane Smith" ],
64+ investigators = [PIDName ( name = "Jane Smith" ) ],
6465 )
6566
6667 r1 = DerivedDataDescription (
@@ -72,7 +73,7 @@ def test_constructors(self):
7273 modality = da .modality ,
7374 platform = da .platform ,
7475 subject_id = da .subject_id ,
75- investigators = ["Jane Smith" ],
76+ investigators = [PIDName ( name = "Jane Smith" ) ],
7677 )
7778
7879 r2 = DerivedDataDescription (
@@ -84,7 +85,7 @@ def test_constructors(self):
8485 modality = r1 .modality ,
8586 platform = r1 .platform ,
8687 subject_id = "12345" ,
87- investigators = ["Jane Smith" ],
88+ investigators = [PIDName ( name = "Jane Smith" ) ],
8889 )
8990
9091 r3 = DerivedDataDescription (
@@ -96,7 +97,7 @@ def test_constructors(self):
9697 modality = r2 .modality ,
9798 platform = r2 .platform ,
9899 subject_id = "12345" ,
99- investigators = ["Jane Smith" ],
100+ investigators = [PIDName ( name = "Jane Smith" ) ],
100101 )
101102 assert r3 is not None
102103
@@ -109,7 +110,7 @@ def test_constructors(self):
109110 creation_time = dt ,
110111 institution = Organization .AIND ,
111112 funding_source = [f ],
112- investigators = ["Jane Smith" ],
113+ investigators = [PIDName ( name = "Jane Smith" ) ],
113114 )
114115
115116 assert dd is not None
@@ -125,7 +126,7 @@ def test_constructors(self):
125126 creation_time = dt ,
126127 institution = Organization .AIND ,
127128 funding_source = [f ],
128- investigators = ["Jane Smith" ],
129+ investigators = [PIDName ( name = "Jane Smith" ) ],
129130 )
130131
131132 ad = AnalysisDescription (
@@ -137,7 +138,7 @@ def test_constructors(self):
137138 platform = Platform .EXASPIM ,
138139 institution = Organization .AIND ,
139140 funding_source = [f ],
140- investigators = ["Jane Smith" ],
141+ investigators = [PIDName ( name = "Jane Smith" ) ],
141142 )
142143 self .assertEqual (ad .name , build_data_name ("project_analysis" , dt ))
143144
@@ -151,7 +152,7 @@ def test_constructors(self):
151152 creation_time = dt ,
152153 institution = Organization .AIND ,
153154 funding_source = [f ],
154- investigators = ["Jane Smith" ],
155+ investigators = [PIDName ( name = "Jane Smith" ) ],
155156 )
156157
157158 with self .assertRaises (ValueError ):
@@ -185,7 +186,7 @@ def test_constructors(self):
185186 creation_time = dt ,
186187 institution = Organization .AIND ,
187188 funding_source = [f ],
188- investigators = ["Jane Smith" ],
189+ investigators = [PIDName ( name = "Jane Smith" ) ],
189190 )
190191
191192 with self .assertRaises (ValueError ):
@@ -198,7 +199,7 @@ def test_constructors(self):
198199 creation_time = dt ,
199200 institution = Organization .AIND ,
200201 funding_source = [f ],
201- investigators = ["Jane Smith" ],
202+ investigators = [PIDName ( name = "Jane Smith" ) ],
202203 )
203204
204205 def test_pattern_errors (self ):
@@ -214,7 +215,7 @@ def test_pattern_errors(self):
214215 creation_time = datetime .datetime (2020 , 10 , 10 , 10 , 10 , 10 ),
215216 institution = Organization .AIND ,
216217 funding_source = [Funding (funder = Organization .NINDS , grant_number = "grant001" )],
217- investigators = ["Jane Smith" ],
218+ investigators = [PIDName ( name = "Jane Smith" ) ],
218219 )
219220 expected_exception = (
220221 "1 validation error for DataDescription\n "
@@ -278,7 +279,7 @@ def test_name_label_error(self):
278279 creation_time = datetime .datetime (2020 , 10 , 10 , 10 , 10 , 10 ),
279280 institution = Organization .AIND ,
280281 funding_source = [Funding (funder = Organization .NINDS , grant_number = "grant001" )],
281- investigators = ["Jane Smith" ],
282+ investigators = [PIDName ( name = "Jane Smith" ) ],
282283 )
283284 self .assertTrue ("Value error, Either label or name must be set" in repr (e .exception ))
284285
@@ -295,7 +296,7 @@ def test_round_trip(self):
295296 modality = [Modality .SPIM ],
296297 platform = Platform .EXASPIM ,
297298 subject_id = "12345" ,
298- investigators = ["Jane Smith" ],
299+ investigators = [PIDName ( name = "Jane Smith" ) ],
299300 )
300301
301302 da2 = RawDataDescription .model_validate_json (da1 .model_dump_json ())
@@ -355,7 +356,7 @@ def test_from_data_description(self):
355356 creation_time = datetime .datetime (2020 , 10 , 10 , 10 , 10 , 10 ),
356357 institution = Organization .AIND ,
357358 funding_source = [Funding (funder = Organization .NINDS , grant_number = "grant001" )],
358- investigators = ["Jane Smith" ],
359+ investigators = [PIDName ( name = "Jane Smith" ) ],
359360 )
360361
361362 process_name = "spikesorter"
@@ -377,7 +378,7 @@ def test_derived_data_description_build_name(self):
377378 modality = [Modality .ECEPHYS ],
378379 platform = Platform .ECEPHYS ,
379380 subject_id = "12345" ,
380- investigators = ["Jane Smith" ],
381+ investigators = [PIDName ( name = "Jane Smith" ) ],
381382 )
382383 self .assertEqual ("input_2020-10-10_10-10-10" , dd .name )
383384
0 commit comments