def ensure_files(self, job, job_dir): """ Download remote files and find secondary files according to annotations """ inputs = job.app.inputs self.input_collector = InputCollector(job_dir) input_values = job.inputs self._resolve(inputs, input_values, job.inputs)
def ensure_files(self, job, job_dir): ''' Resolve paths of all input files ''' inputs = job.app.inputs.io self.input_collector = InputCollector(job_dir) input_values = job.inputs self._resolve(inputs, input_values, job.inputs)
class Container(object): def __init__(self): self.input_collector = None def install(self, job): pass def get_mapping(self, paths): return {} def ensure_files(self, job, job_dir): """ Download remote files and find secondary files according to annotations """ inputs = job.app.inputs self.input_collector = InputCollector(job_dir) input_values = job.inputs self._resolve(inputs, input_values, job.inputs) def _resolve(self, inputs, input_values, job): if inputs: file_ins = [ i for i in inputs if isinstance(i.validator, NamedSchema) and i.validator.name == 'File' ] for f in file_ins: val = input_values.get(f.id) if val: job[f.id] = map_or_apply( lambda e: self.input_collector.download( e.url, f.input_binding.get('secondaryFiles') if f.input_binding is not None else None), val)
class Container(object): def __init__(self): self.input_collector = None def install(self, job): pass def get_mapping(self, paths): return {} def ensure_files(self, job, job_dir): """ Download remote files and find secondary files according to annotations """ inputs = job.app.inputs self.input_collector = InputCollector(job_dir) input_values = job.inputs self._resolve(inputs, input_values, job.inputs) def _resolve(self, inputs, input_values, job): if inputs: file_ins = [i for i in inputs if isinstance(i.validator, NamedSchema) and i.validator.name == 'File'] for f in file_ins: val = input_values.get(f.id) if val: job[f.id] = map_or_apply( lambda e: self.input_collector.download( e.url, f.input_binding.get('secondaryFiles') if f.input_binding is not None else None ), val)
class Container(object): def __init__(self): self.input_collector = None def install(self, job): pass def set_config(self, *args, **kwargs): pass def ensure_files(self, job, job_dir): ''' Resolve paths of all input files ''' inputs = job.app.inputs.io self.input_collector = InputCollector(job_dir) input_values = job.inputs self._resolve(inputs, input_values, job.inputs) def _resolve(self, inputs, input_values, job): if inputs: file_ins = [ i for i in inputs if isinstance(i.constructor, FileConstructor) ] for f in file_ins: val = input_values.get(f.id) if val: job[f.id] = map_or_apply( lambda e: self.input_collector.download( e.url, f.annotations.get('secondaryFiles') if f.annotations is not None else None), val)