@@ -256,13 +256,16 @@ def add_results(self, results):
256
256
inputs = results .inputs
257
257
outputs = results .outputs
258
258
classname = interface .__name__
259
+ modulepath = "{0}.{1}" .format (interface .__module__ , interface .__name__ )
260
+ activitytype = '' .join ([i .capitalize () for i in modulepath .split ('.' )])
259
261
260
262
a0_attrs = {nipype_ns ['module' ]: interface .__module__ ,
261
263
nipype_ns ["interface" ]: classname ,
264
+ pm .PROV ["type" ]: nipype_ns [activitytype ],
262
265
pm .PROV ["label" ]: classname ,
263
266
nipype_ns ['duration' ]: safe_encode (runtime .duration ),
264
- nipype_ns ['working_directory ' ]: safe_encode (runtime .cwd ),
265
- nipype_ns ['return_code ' ]: safe_encode (runtime .returncode ),
267
+ nipype_ns ['workingDirectory ' ]: safe_encode (runtime .cwd ),
268
+ nipype_ns ['returnCode ' ]: safe_encode (runtime .returncode ),
266
269
nipype_ns ['platform' ]: safe_encode (runtime .platform ),
267
270
nipype_ns ['version' ]: safe_encode (runtime .version ),
268
271
}
@@ -274,7 +277,7 @@ def add_results(self, results):
274
277
275
278
try :
276
279
a0_attrs .update ({nipype_ns ['command' ]: safe_encode (runtime .cmdline )})
277
- a0_attrs .update ({nipype_ns ['command_path ' ]:
280
+ a0_attrs .update ({nipype_ns ['commandPath ' ]:
278
281
safe_encode (runtime .command_path )})
279
282
a0_attrs .update ({nipype_ns ['dependencies' ]:
280
283
safe_encode (runtime .dependencies )})
@@ -286,7 +289,7 @@ def add_results(self, results):
286
289
id = get_id ()
287
290
env_collection = self .g .collection (id )
288
291
env_collection .add_extra_attributes ({pm .PROV ['type' ]:
289
- nipype_ns ['environment ' ],
292
+ nipype_ns ['Environment ' ],
290
293
pm .PROV ['label' ]: "Environment" })
291
294
self .g .used (a0 , id )
292
295
# write environment entities
@@ -299,7 +302,7 @@ def add_results(self, results):
299
302
'MKL_NUM_THREADS' , 'OMP_NUM_THREADS' ]:
300
303
continue
301
304
in_attr = {pm .PROV ["label" ]: key ,
302
- nipype_ns ["environment_variable " ]: key ,
305
+ nipype_ns ["environmentVariable " ]: key ,
303
306
pm .PROV ["value" ]: safe_encode (val )}
304
307
id = get_attr_id (in_attr )
305
308
self .g .entity (id , in_attr )
@@ -309,14 +312,14 @@ def add_results(self, results):
309
312
id = get_id ()
310
313
input_collection = self .g .collection (id )
311
314
input_collection .add_extra_attributes ({pm .PROV ['type' ]:
312
- nipype_ns ['inputs ' ],
315
+ nipype_ns ['Inputs ' ],
313
316
pm .PROV ['label' ]: "Inputs" })
314
317
# write input entities
315
318
for idx , (key , val ) in enumerate (sorted (inputs .items ())):
316
319
in_entity = prov_encode (self .g , val ).get_identifier ()
317
320
self .g .hadMember (input_collection , in_entity )
318
321
used_attr = {pm .PROV ["label" ]: key ,
319
- nipype_ns ["in_port " ]: key }
322
+ nipype_ns ["inPort " ]: key }
320
323
self .g .used (activity = a0 , entity = in_entity ,
321
324
other_attributes = used_attr )
322
325
# write output entities
@@ -326,7 +329,7 @@ def add_results(self, results):
326
329
if not isinstance (outputs , dict ):
327
330
outputs = outputs .get_traitsfree ()
328
331
output_collection .add_extra_attributes ({pm .PROV ['type' ]:
329
- nipype_ns ['outputs ' ],
332
+ nipype_ns ['Outputs ' ],
330
333
pm .PROV ['label' ]:
331
334
"Outputs" })
332
335
self .g .wasGeneratedBy (output_collection , a0 )
@@ -335,14 +338,14 @@ def add_results(self, results):
335
338
out_entity = prov_encode (self .g , val ).get_identifier ()
336
339
self .g .hadMember (output_collection , out_entity )
337
340
gen_attr = {pm .PROV ["label" ]: key ,
338
- nipype_ns ["out_port " ]: key }
341
+ nipype_ns ["outPort " ]: key }
339
342
self .g .generation (out_entity , activity = a0 ,
340
343
other_attributes = gen_attr )
341
344
# write runtime entities
342
345
id = get_id ()
343
346
runtime_collection = self .g .collection (id )
344
347
runtime_collection .add_extra_attributes ({pm .PROV ['type' ]:
345
- nipype_ns ['runtime ' ],
348
+ nipype_ns ['Runtime ' ],
346
349
pm .PROV ['label' ]:
347
350
"RuntimeInfo" })
348
351
self .g .wasGeneratedBy (runtime_collection , a0 )
0 commit comments