Skip to content

Commit 4223a88

Browse files
committed
single command
1 parent f1a6945 commit 4223a88

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

qiita_db/metadata_template/prep_template.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,9 @@ def _get_predecessors(workflow, node):
903903
# let's just keep one, let's give it preference to the one with the
904904
# most total_conditions_satisfied
905905
_, wk = sorted(workflows, key=lambda x: x[0], reverse=True)[0]
906+
GH = wk.graph
906907
missing_artifacts = dict()
907-
for node, degree in wk.graph.out_degree():
908+
for node, degree in GH.out_degree():
908909
if degree != 0:
909910
continue
910911
mscheme = _get_node_info(wk, node)
@@ -982,7 +983,18 @@ def _get_predecessors(workflow, node):
982983
raise ValueError(msg)
983984
req_params[iname] = init_artifacts[dname]
984985
if len(dp.command.required_parameters) > 1:
985-
raise ValueError('Not implemented')
986+
for pn in GH.predecessors(node):
987+
info = _get_node_info(wk, pn)
988+
n, cnx, _ = GH.get_edge_data(
989+
pn, node)['connections'].connections[0]
990+
if info not in merging_schemes or \
991+
n not in merging_schemes[info]:
992+
msg = ('This workflow contains a step with '
993+
'multiple inputs so it cannot be '
994+
'completed automatically, please add '
995+
'the commands by hand.')
996+
raise ValueError(msg)
997+
req_params[cnx] = merging_schemes[info][n]
986998
else:
987999
if len(dp.command.required_parameters) == 1:
9881000
cxns = dict()
@@ -991,7 +1003,6 @@ def _get_predecessors(workflow, node):
9911003
cxns[dname] = iname
9921004
connections = {previous_job: cxns}
9931005
else:
994-
GH = wk.graph
9951006
connections = dict()
9961007
for pn in GH.predecessors(node):
9971008
pndp = pn.default_parameter

0 commit comments

Comments
 (0)