Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)