You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposal to extend the PipelineTask class in the pipeliner module to make it easier to create directories, and move or copy files created by the task. These would be most useful for removing boilerplate code from the task-specific finish methods, where often it seems necessary to know explicitly where files have been created by the task.
For example, something like:
if not os.path.exists(self.args.out_dir):
os.makedirs(self.args.out_dir)
could be replaced by:
self.makedirs(self.args.out_dir)
which could provide a consistent interface and wrap all the required checks.
Another example:
for output in expected_outputs:
f = "%s.%s" % (self.args.name,output)
if os.path.exists(os.path.join(self.args.out_dir,f)):
continue
else:
if os.path.exists(f):
shutil.copy(f,self.args.out_dir)
could be replaced by something like:
for output in expected_outputs:
self.export_file("%s.%s" % (self.args.name,output),self.args.out_dir)
By convention, relative paths would be considered to be within the task working directory (absolute paths would be used as-is). It might also be useful if the pipeline infrastructure was extended to run each job in a dedicated working directory.
Additional optional arguments could be provided e.g. to avoid overwriting existing files etc.
Other potentially useful methods might be to check for the existence of files.
The text was updated successfully, but these errors were encountered:
Proposal to extend the
PipelineTask
class in thepipeliner
module to make it easier to create directories, and move or copy files created by the task. These would be most useful for removing boilerplate code from the task-specificfinish
methods, where often it seems necessary to know explicitly where files have been created by the task.For example, something like:
could be replaced by:
which could provide a consistent interface and wrap all the required checks.
Another example:
could be replaced by something like:
By convention, relative paths would be considered to be within the task working directory (absolute paths would be used as-is). It might also be useful if the pipeline infrastructure was extended to run each job in a dedicated working directory.
Additional optional arguments could be provided e.g. to avoid overwriting existing files etc.
Other potentially useful methods might be to check for the existence of files.
The text was updated successfully, but these errors were encountered: