Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Commit 6d19e63

Browse files
committed
Ensure Workflow Output param is labelled + document workflow 'in' method
1 parent 36cc0ff commit 6d19e63

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

cwlgen/workflowdeps.py

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,26 @@ def parse_with_id(cls, d, identifier):
134134
return super(WorkflowStepInput, cls).parse_dict(d)
135135

136136

137+
class WorkflowStepOutput(Serializable):
138+
"""
139+
Associate an output parameter of the underlying process with a workflow parameter.
140+
The workflow parameter (given in the id field) be may be used as a source to connect with
141+
input parameters of other workflow steps, or with an output parameter of the process.
142+
143+
Documentation: https://www.commonwl.org/v1.0/Workflow.html#WorkflowStepOutput
144+
"""
145+
def __init__(self, output_id):
146+
"""
147+
:param output_id: A unique identifier for this workflow output parameter. This is the identifier to use in
148+
the source field of WorkflowStepInput to connect the output value to downstream parameters.
149+
:type output_id: STRING
150+
"""
151+
self.id = output_id
152+
153+
def get_dict(self):
154+
return self.id
155+
156+
137157
class WorkflowStep(Serializable):
138158
"""
139159
A workflow step is an executable element of a workflow. It specifies the underlying process implementation
@@ -143,7 +163,11 @@ class WorkflowStep(Serializable):
143163
Documentation: https://www.commonwl.org/v1.0/Workflow.html#WorkflowStep
144164
"""
145165

146-
parse_types = {"inputs": [[WorkflowStepInput]]}
166+
# dict['in'] gets converted to dict['inputs'] as 'in' is a reserved keyword
167+
parse_types = {
168+
"inputs": [[WorkflowStepInput]],
169+
"out": [[WorkflowStepOutput]]
170+
}
147171

148172
def __init__(self, step_id, run, label=None, doc=None, scatter=None, scatter_method=None):
149173
"""
@@ -192,26 +216,6 @@ def parse_dict(cls, d):
192216
return super(WorkflowStep, cls).parse_dict(d)
193217

194218

195-
class WorkflowStepOutput(Serializable):
196-
"""
197-
Associate an output parameter of the underlying process with a workflow parameter.
198-
The workflow parameter (given in the id field) be may be used as a source to connect with
199-
input parameters of other workflow steps, or with an output parameter of the process.
200-
201-
Documentation: https://www.commonwl.org/v1.0/Workflow.html#WorkflowStepOutput
202-
"""
203-
def __init__(self, output_id):
204-
"""
205-
:param output_id: A unique identifier for this workflow output parameter. This is the identifier to use in
206-
the source field of WorkflowStepInput to connect the output value to downstream parameters.
207-
:type output_id: STRING
208-
"""
209-
self.id = output_id
210-
211-
def get_dict(self):
212-
return self.id
213-
214-
215219
class WorkflowOutputParameter(Parameter):
216220
"""
217221
Describe an output parameter of a workflow. The parameter must be connected to one or more parameters

0 commit comments

Comments
 (0)