cwl_utils.parser.utils

CWL parser utility functions.

Module Contents

Functions

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)

static_checker(workflow)

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

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

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.

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

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:
  • version (str) –

  • path (Union[str, pathlib.Path]) –

  • loadingOptions (Optional[cwl_utils.parser.LoadingOptions]) –

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:
  • version (str) –

  • doc (Any) –

  • baseuri (Optional[str]) –

  • loadingOptions (Optional[cwl_utils.parser.LoadingOptions]) –

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:
  • version (str) –

  • string (str) –

  • uri (str) –

  • loadingOptions (Optional[cwl_utils.parser.LoadingOptions]) –

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:
  • version (str) –

  • yaml (Any) –

  • uri (str) –

  • loadingOptions (Optional[cwl_utils.parser.LoadingOptions]) –

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.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, sourcenames, parent=None, linkMerge=None, pickValue=None)

Determine the type for the given sourcenames.

Parameters:
  • process (cwl_utils.parser.Process) –

  • sourcenames (Union[str, List[str]]) –

  • parent (Optional[cwl_utils.parser.Workflow]) –

  • linkMerge (Optional[str]) –

  • pickValue (Optional[str]) –

Return type:

Any

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

Determine the type for the given step output.

Parameters:
  • step (cwl_utils.parser.WorkflowStep) –

  • in_ (cwl_utils.parser.WorkflowStepInput) –

  • cwlVersion (str) –

Return type:

Any

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

Determine the type for the given step output.

Parameters:
  • step (cwl_utils.parser.WorkflowStep) –

  • sourcename (str) –

  • cwlVersion (str) –

Return type:

Any

cwl_utils.parser.utils.param_for_source_id(process, sourcenames, parent=None, scatter_context=None)
Parameters:
  • process (Union[cwl_utils.parser.CommandLineTool, cwl_utils.parser.Workflow, cwl_utils.parser.ExpressionTool]) –

  • sourcenames (Union[str, List[str]]) –

  • parent (Optional[cwl_utils.parser.Workflow]) –

  • scatter_context (Optional[List[Optional[Tuple[int, str]]]]) –

Return type:

Union[Union[List[cwl_utils.parser.cwl_v1_0.InputParameter], cwl_utils.parser.cwl_v1_0.InputParameter], Union[List[cwl_utils.parser.cwl_v1_1.WorkflowInputParameter], cwl_utils.parser.cwl_v1_1.WorkflowInputParameter], Union[List[cwl_utils.parser.cwl_v1_2.WorkflowInputParameter], cwl_utils.parser.cwl_v1_2.WorkflowInputParameter]]