Esempio n. 1
0
    def from_dict(cls, context, d):
        converted = {}
        for k, v in six.iteritems(d):
            if k == 'steps':
                converted[k] = [Step.from_dict(context, s) for s in v]
            else:
                converted[k] = context.from_dict(v)

        kwargs = Process.kwarg_dict(converted)
        kwargs.update({
            'steps':
            converted['steps'],
            'data_links':
            converted.get('dataLinks'),
            'context':
            context,
            'inputs': [
                InputParameter.from_dict(context, i)
                for i in converted['inputs']
            ],
            'outputs': [
                WorkflowOutput.from_dict(context, o)
                for o in converted['outputs']
            ]
        })
        return cls(**kwargs)
Esempio n. 2
0
 def from_dict(cls, context, d):
     converted = {k: context.from_dict(v) for k, v in six.iteritems(d)}
     kwargs = Process.kwarg_dict(converted)
     kwargs.update({
         'script': d['script'],
         'engine': d['engine'],
         'context': context,
         'inputs': [InputParameter.from_dict(context, inp)
                    for inp in converted.get('inputs', [])],
         'outputs': [OutputParameter.from_dict(context, inp)
                     for inp in converted.get('outputs', [])]
     })
     return cls(**kwargs)
Esempio n. 3
0
 def from_dict(cls, context, d):
     converted = {k: context.from_dict(v) for k, v in six.iteritems(d)}
     kwargs = Process.kwarg_dict(converted)
     kwargs.update({
         'base_command': converted['baseCommand'],
         'arguments': converted.get('arguments'),
         'stdin': converted.get('stdin'),
         'stdout': converted.get('stdout'),
         'inputs': [InputParameter.from_dict(context, inp)
                    for inp in converted.get('inputs', [])],
         'outputs': [OutputParameter.from_dict(context, inp)
                     for inp in converted.get('outputs', [])]
     })
     return cls(**kwargs)
Esempio n. 4
0
 def from_dict(cls, context, d):
     cls.infer_step_id(d)
     converted = {
         k: process_builder(context, v) if k == 'run' else context.from_dict(v)
         for k, v in six.iteritems(d)
     }
     kwargs = Process.kwarg_dict(converted)
     kwargs.update({
         'app': converted['run'],
         'inputs': [WorkflowStepInput.from_dict(context, inp)
                    for inp in converted.get('inputs', [])],
         'outputs': [OutputParameter.from_dict(context, inp)
                     for inp in converted.get('outputs', [])],
         'scatter': converted.get('scatter')
     })
     return cls(**kwargs)
Esempio n. 5
0
    def from_dict(cls, context, d):
        converted = {}
        for k, v in six.iteritems(d):
            if k == 'steps':
                converted[k] = [Step.from_dict(context, s) for s in v]
            else:
                converted[k] = context.from_dict(v)

        kwargs = Process.kwarg_dict(converted)
        kwargs.update({
            'steps': converted['steps'],
            'data_links': converted.get('dataLinks'),
            'context': context,
            'inputs': [InputParameter.from_dict(context, i)
                       for i in converted['inputs']],
            'outputs': [WorkflowOutput.from_dict(context, o)
                        for o in converted['outputs']]
        })
        return cls(**kwargs)
Esempio n. 6
0
 def from_dict(cls, context, d):
     converted = {k: context.from_dict(v) for k, v in six.iteritems(d)}
     kwargs = Process.kwarg_dict(converted)
     kwargs.update({
         'script':
         d['expression']['script'],
         'engine':
         d['expression']['engine'],
         'context':
         context,
         'inputs': [
             InputParameter.from_dict(context, inp)
             for inp in converted.get('inputs', [])
         ],
         'outputs': [
             OutputParameter.from_dict(context, inp)
             for inp in converted.get('outputs', [])
         ]
     })
     return cls(**kwargs)
Esempio n. 7
0
 def from_dict(cls, context, d):
     converted = {k: context.from_dict(v) for k, v in six.iteritems(d)}
     kwargs = Process.kwarg_dict(converted)
     kwargs.update({
         'base_command':
         converted['baseCommand'],
         'arguments':
         converted.get('arguments'),
         'stdin':
         converted.get('stdin'),
         'stdout':
         converted.get('stdout'),
         'inputs': [
             InputParameter.from_dict(context, inp)
             for inp in converted.get('inputs', [])
         ],
         'outputs': [
             OutputParameter.from_dict(context, inp)
             for inp in converted.get('outputs', [])
         ]
     })
     return cls(**kwargs)
Esempio n. 8
0
 def from_dict(cls, context, d):
     cls.infer_step_id(d)
     converted = {
         k:
         process_builder(context, v) if k == 'run' else context.from_dict(v)
         for k, v in six.iteritems(d)
     }
     kwargs = Process.kwarg_dict(converted)
     kwargs.update({
         'app':
         converted['run'],
         'inputs': [
             WorkflowStepInput.from_dict(context, inp)
             for inp in converted.get('inputs', [])
         ],
         'outputs': [
             OutputParameter.from_dict(context, inp)
             for inp in converted.get('outputs', [])
         ],
         'scatter':
         converted.get('scatter')
     })
     return cls(**kwargs)