Skip to content
Snippets Groups Projects
Commit cb8a4593 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[algorithm] Add loop information parsing

The format is:

"loop": {
    "input": {
        "type": "data_format_name"
    },
    "output": {
        "type": "data_format_name"
    }
}
parent c20305f2
No related branches found
No related tags found
2 merge requests!281.6.x,!27Soft loop
...@@ -419,6 +419,8 @@ class Algorithm(object): ...@@ -419,6 +419,8 @@ class Algorithm(object):
for k,v in g['inputs'].items()]) for k,v in g['inputs'].items()])
self.output_map = dict([(k,v['type']) for g in self.groups \ self.output_map = dict([(k,v['type']) for g in self.groups \
for k,v in g.get('outputs', {}).items()]) for k,v in g.get('outputs', {}).items()])
self.loop_map = dict([(k,v['type']) for g in self.groups \
for k,v in g.get('loop', {}).items()])
self._load_dataformats(dataformat_cache) self._load_dataformats(dataformat_cache)
self._convert_parameter_types() self._convert_parameter_types()
...@@ -457,6 +459,23 @@ class Algorithm(object): ...@@ -457,6 +459,23 @@ class Algorithm(object):
self.dataformats[output['type']] = thisformat self.dataformats[output['type']] = thisformat
if 'loop' not in group:
continue
for name, entry in group['loop'].items():
entry_format = entry['type']
if entry_format in self.dataformats:
continue
if dataformat_cache and entry_format in dataformat_cache:
thisformat = dataformat_cache[entry_format]
else:
thisformat = dataformat.DataFormat(self.prefix, entry_format)
if dataformat_cache is not None:
dataformat_cache[entry_format] = thisformat
self.dataformats[entry_format] = thisformat
if self.results: if self.results:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment