cwl_utils.parser.utils

CWL parser utility functions.

Functions

can_assign_src_to_sink(src, sink[, strict])

Check for identical type specifications, ignoring extra keys like inputBinding.

check_types(srctype, sinktype, linkMerge[, valueFrom])

Check if the source and sink types are correct.

convert_stdstreams_to_files(process)

Convert stdin, stdout and stderr type shortcuts to files.

load_inputfile_by_uri(version, path[, loadingOptions])

Load a CWL input file from a URI or a path.

load_inputfile(version, doc[, baseuri, loadingOptions])

Load a CWL input file from a serialized YAML string or a YAML object.

load_inputfile_by_string(version, string, uri[, ...])

Load a CWL input file from a serialized YAML string.

load_inputfile_by_yaml(version, yaml, uri[, ...])

Load a CWL input file from a YAML object.

load_step(step)

merge_flatten_type(src)

Return the merge flattened type of the source type.

param_for_source_id(process, sourcenames[, parent, ...])

Find the process input parameter that matches one of the given sourcenames.

static_checker(workflow)

Check if all source and sink types of a workflow are compatible before run time.

type_for_source(process, cwlVersion, sourcenames[, ...])

Determine the type for the given sourcenames.

type_for_step_input(step, in_, cwlVersion)

Determine the type for the given step output.

type_for_step_output(step, sourcename, cwlVersion)

Determine the type for the given step output.

Module Contents

cwl_utils.parser.utils.can_assign_src_to_sink(src, sink, strict=False)

Check for identical type specifications, ignoring extra keys like inputBinding.

src: admissible source types sink: admissible sink types

In non-strict comparison, at least one source type must match one sink type, except for ‘null’. In strict comparison, all source types must match at least one sink type.

Parameters:
  • src (Any)

  • sink (Any)

  • strict (bool)

Return type:

bool

cwl_utils.parser.utils.check_types(srctype, sinktype, linkMerge, valueFrom=None)

Check if the source and sink types are correct.

Acceptable types are “pass”, “warning”, or “exception”.

Parameters:
  • srctype (Any)

  • sinktype (Any)

  • linkMerge (str | None)

  • valueFrom (str | None)

Return type:

str

cwl_utils.parser.utils.convert_stdstreams_to_files(process)

Convert stdin, stdout and stderr type shortcuts to files.

Parameters:

process (cwl_utils.parser.Process)

Return type:

None

cwl_utils.parser.utils.load_inputfile_by_uri(version, path, loadingOptions=None)

Load a CWL input file from a URI or a path.

Parameters:
Return type:

Any

cwl_utils.parser.utils.load_inputfile(version, doc, baseuri=None, loadingOptions=None)

Load a CWL input file from a serialized YAML string or a YAML object.

Parameters:
Return type:

Any

cwl_utils.parser.utils.load_inputfile_by_string(version, string, uri, loadingOptions=None)

Load a CWL input file from a serialized YAML string.

Parameters:
Return type:

Any

cwl_utils.parser.utils.load_inputfile_by_yaml(version, yaml, uri, loadingOptions=None)

Load a CWL input file from a YAML object.

Parameters:
Return type:

Any

cwl_utils.parser.utils.load_step(step)
Parameters:

step (cwl_utils.parser.WorkflowStep)

Return type:

cwl_utils.parser.Process

cwl_utils.parser.utils.merge_flatten_type(src)

Return the merge flattened type of the source type.

Parameters:

src (Any)

Return type:

Any

cwl_utils.parser.utils.param_for_source_id(process, sourcenames, parent=None, scatter_context=None)

Find the process input parameter that matches one of the given sourcenames.

Parameters:
Return type:

cwl_utils.parser.CommandInputParameter | cwl_utils.parser.CommandOutputParameter | cwl_utils.parser.WorkflowInputParameter | collections.abc.MutableSequence[cwl_utils.parser.CommandInputParameter | cwl_utils.parser.CommandOutputParameter | cwl_utils.parser.WorkflowInputParameter]

cwl_utils.parser.utils.static_checker(workflow)

Check if all source and sink types of a workflow are compatible before run time.

Parameters:

workflow (cwl_utils.parser.Workflow)

Return type:

None

cwl_utils.parser.utils.type_for_source(process, cwlVersion, sourcenames, parent=None, linkMerge=None, pickValue=None)

Determine the type for the given sourcenames.

Parameters:
Return type:

Any

cwl_utils.parser.utils.type_for_step_input(step, in_, cwlVersion)

Determine the type for the given step output.

Parameters:
Return type:

Any

cwl_utils.parser.utils.type_for_step_output(step, sourcename, cwlVersion)

Determine the type for the given step output.

Parameters:
Return type:

Any