scriptcwl.step module

exception scriptcwl.step.PackedWorkflowException

Bases: exceptions.Exception

Error raised when trying to load a packed workflow.

class scriptcwl.step.Step(fname)

Bases: object

Representation of a CWL step.

The Step can be a CommandLineTool or a Workflow. Steps are read from file and validated using cwltool.

get_input_names()

Return the Step’s input names (including optional input names).

Returns:
list of strings.
list_inputs()

Return a string listing all the Step’s input names and their types.

The types are returned in a copy/pastable format, so if the type is string, ‘string’ (with single quotes) is returned.

Returns:
str containing all input names and types.
output_reference(name)
Return a reference to the given output for use in an input
of a next Step.

For a Step named echo that has an output called echoed, the reference echo/echoed is returned.

Args:
name (str): the name of the Step output
Raises:
ValueError: The name provided is not a valid output name for this
Step.
set_input(name, value)

Set a Step’s input variable to a certain value.

The value comes either from a workflow input or output of a previous
step.
Args:

name (str): the name of the Step input value (str): the name of the output variable that provides the

value for this input.
Raises:
ValueError: The name provided is not a valid input name for this
Step.
to_obj(inline=False, wd=False, pack=False, relpath=None)

Return the step as an dict that can be written to a yaml file.

Returns:
dict: yaml representation of the step.
scriptcwl.step.iri2fragment(iri)

Return the fragment of an IRI.

Args:
iri (str): the iri.
Returns:
str: the fragment of the iri.
scriptcwl.step.python_name(name)

Transform cwl step name into a python method name.

Args:
name (str): CWL step name to convert.
Returns:
str: converted name.