Added alternate option to one_task_per_input_file to encode specification of input...
authorPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 21 Feb 2014 16:23:46 +0000 (11:23 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Fri, 21 Feb 2014 16:23:46 +0000 (11:23 -0500)
sdk/python/arvados/__init__.py

index 00f31caa6a13fcacd10f5c6a63e659c3894a2ce1..42c4b3aae63b4c460fa4fc19bea3180c41fb5d9f 100644 (file)
@@ -71,14 +71,17 @@ class JobTask(object):
 
 class job_setup:
     @staticmethod
-    def one_task_per_input_file(if_sequence=0, and_end_task=True):
+    def one_task_per_input_file(if_sequence=0, and_end_task=True, input_as_path=False):
         if if_sequence != current_task()['sequence']:
             return
         job_input = current_job()['script_parameters']['input']
         cr = CollectionReader(job_input)
         for s in cr.all_streams():
             for f in s.all_files():
-                task_input = f.as_manifest()
+                if input_as_path:
+                    task_input = os.path.join(job_input, s.name(), f.name())
+                else:
+                    task_input = f.as_manifest()
                 new_task_attrs = {
                     'job_uuid': current_job()['uuid'],
                     'created_by_job_task_uuid': current_task()['uuid'],