Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.backend.python
Commits
9aedbc01
Commit
9aedbc01
authored
Jul 11, 2019
by
Samuel GAIST
Browse files
[helpers] Add output parsing for loop
parent
4eb0c5a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/backend/python/helpers.py
View file @
9aedbc01
...
...
@@ -82,6 +82,12 @@ def parse_inputs(inputs):
return
data
def
parse_outputs
(
outputs
):
return
dict
(
[(
k
,
{
"channel"
:
v
[
"channel"
],
"path"
:
v
[
"path"
]})
for
k
,
v
in
outputs
.
items
()]
)
def
convert_loop_to_container
(
config
):
data
=
{
"algorithm"
:
config
[
"algorithm"
],
...
...
@@ -91,7 +97,7 @@ def convert_loop_to_container(config):
}
data
[
"inputs"
]
=
parse_inputs
(
config
[
"inputs"
])
data
[
"outputs"
]
=
parse_outputs
(
config
[
"outputs"
])
return
data
...
...
@@ -109,12 +115,7 @@ def convert_experiment_configuration_to_container(config):
data
[
"inputs"
]
=
parse_inputs
(
config
[
"inputs"
])
if
"outputs"
in
config
:
data
[
"outputs"
]
=
dict
(
[
(
k
,
{
"channel"
:
v
[
"channel"
],
"path"
:
v
[
"path"
]})
for
k
,
v
in
config
[
"outputs"
].
items
()
]
)
data
[
"outputs"
]
=
parse_outputs
(
config
[
"outputs"
])
else
:
data
[
"result"
]
=
{
"channel"
:
config
[
"channel"
],
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment