cwl_utils.expression_refactor
CWL Expression refactoring tool for CWL.
Attributes
Classes
Shortcut type for CWL v1.x parse.save(). |
Functions
Build the argument parser. |
|
|
Parse the command line options. |
|
|
|
|
|
|
|
|
|
Return the expressionLib from the highest priority InlineJavascriptRequirement. |
|
Generate an ExpressionTool to achieve the same result as the given expression. |
|
Determine the CommandInputParameter for the given input name. |
|
If the step's Process is not inline, load and process it. |
|
|
|
Since the InlineJavascriptRequirement is longer needed, remove it. |
|
Console entry point. |
|
Collect the arguments and run. |
|
Primary processing loop. |
Module Contents
- cwl_utils.expression_refactor.defaultStreamHandler
- cwl_utils.expression_refactor.save_type
- class cwl_utils.expression_refactor.saveCWL
Bases:
Protocol
Shortcut type for CWL v1.x parse.save().
- cwl_utils.expression_refactor.arg_parser()
Build the argument parser.
- Return type:
- cwl_utils.expression_refactor.parse_args(args)
Parse the command line options.
- Parameters:
- Return type:
- cwl_utils.expression_refactor.add_input_to_process(process, cwlVersion, name, inptype, loadingOptions)
- Parameters:
process (cwl_utils.parser.Process)
cwlVersion (Literal['v1.0', 'v1.1', 'v1.2'])
name (str)
inptype (Any)
loadingOptions (schema_salad.runtime.LoadingOptions)
- Return type:
None
- cwl_utils.expression_refactor.cltool_inputs_to_etool_inputs(tool, cwlVersion)
- Parameters:
cwlVersion (Literal['v1.0', 'v1.1', 'v1.2'])
- Return type:
collections.abc.Sequence[cwl_utils.parser.WorkflowInputParameter]
- cwl_utils.expression_refactor.empty_inputs(process_or_step, cwlVersion, parent=None)
- Parameters:
process_or_step (cwl_utils.parser.Process | cwl_utils.parser.WorkflowStep)
cwlVersion (Literal['v1.0', 'v1.1', 'v1.2'])
parent (cwl_utils.parser.Workflow | None)
- Return type:
- cwl_utils.expression_refactor.etool_to_cltool(etool, cwlVersion, expressionLib=None)
- Parameters:
etool (cwl_utils.parser.ExpressionTool)
cwlVersion (Literal['v1.0', 'v1.1', 'v1.2'])
- Return type:
- cwl_utils.expression_refactor.find_expressionLib(processes)
Return the expressionLib from the highest priority InlineJavascriptRequirement.
processes: should be in order of least important to most important (Workflow, WorkflowStep, … CommandLineTool/ExpressionTool)
- Parameters:
processes (collections.abc.Sequence[cwl_utils.parser.Process | cwl_utils.parser.WorkflowStep])
- Return type:
- cwl_utils.expression_refactor.generate_etool_from_expr2(expr, cwlVersion, target, inputs, self_name=None, process=None, extra_processes=None)
Generate an ExpressionTool to achieve the same result as the given expression.
- Parameters:
expr (str)
cwlVersion (Literal['v1.0', 'v1.1', 'v1.2'])
target (cwl_utils.parser.CommandInputParameter | cwl_utils.parser.WorkflowInputParameter | cwl_utils.parser.OperationInputParameter)
inputs (collections.abc.Sequence[cwl_utils.parser.CommandInputParameter | cwl_utils.parser.CommandOutputParameter | cwl_utils.parser.WorkflowInputParameter])
self_name (str | None)
process (cwl_utils.parser.Process | None)
extra_processes (collections.abc.Sequence[cwl_utils.parser.Process | cwl_utils.parser.WorkflowStep] | None)
- Return type:
- cwl_utils.expression_refactor.get_command_input_parameter(cwlVersion: Literal['v1.0'], id_: str, type_: Any) cwl_utils.parser.cwl_v1_0.CommandInputParameter
- cwl_utils.expression_refactor.get_command_input_parameter(cwlVersion: Literal['v1.1'], id_: str, type_: Any) cwl_utils.parser.cwl_v1_1.CommandInputParameter
- cwl_utils.expression_refactor.get_command_input_parameter(cwlVersion: Literal['v1.2'], id_: str, type_: Any) cwl_utils.parser.cwl_v1_2.CommandInputParameter
- cwl_utils.expression_refactor.get_command_line_binding(cwlVersion: Literal['v1.0'], valueFrom: str | None = ..., loadContents: bool | None = ...) cwl_utils.parser.cwl_v1_0.CommandLineBinding
- cwl_utils.expression_refactor.get_command_line_binding(cwlVersion: Literal['v1.1'], valueFrom: str | None = ..., loadContents: bool | None = ...) cwl_utils.parser.cwl_v1_1.CommandLineBinding
- cwl_utils.expression_refactor.get_command_line_binding(cwlVersion: Literal['v1.2'], valueFrom: str | None = ..., loadContents: bool | None = ...) cwl_utils.parser.cwl_v1_2.CommandLineBinding
- cwl_utils.expression_refactor.get_inline_javascript_requirement(etool: cwl_utils.parser.ExpressionTool, cwlVersion: Literal['v1.0'], expression_lib: list[str] | None) cwl_utils.parser.cwl_v1_0.InlineJavascriptRequirement
- cwl_utils.expression_refactor.get_inline_javascript_requirement(etool: cwl_utils.parser.ExpressionTool, cwlVersion: Literal['v1.1'], expression_lib: list[str] | None) cwl_utils.parser.cwl_v1_1.InlineJavascriptRequirement
- cwl_utils.expression_refactor.get_inline_javascript_requirement(etool: cwl_utils.parser.ExpressionTool, cwlVersion: Literal['v1.2'], expression_lib: list[str] | None) cwl_utils.parser.cwl_v1_2.InlineJavascriptRequirement
- cwl_utils.expression_refactor.get_input_for_id(name, tool)
Determine the CommandInputParameter for the given input name.
- Parameters:
name (str)
tool (cwl_utils.parser.Process)
- Return type:
cwl_utils.parser.CommandInputParameter | cwl_utils.parser.WorkflowInputParameter | cwl_utils.parser.OperationInputParameter | None
- cwl_utils.expression_refactor.load_step(step, replace_etool, skip_command_line1, skip_command_line2)
If the step’s Process is not inline, load and process it.
- cwl_utils.expression_refactor.process_CommandLineTool_output(ctool, cwlVersion, outp_id)
- Parameters:
ctool (cwl_utils.parser.CommandLineTool)
cwlVersion (Literal['v1.0', 'v1.1', 'v1.2'])
outp_id (str)
- Return type:
None
- cwl_utils.expression_refactor.remove_JSReq(process, skip_command_line1)
Since the InlineJavascriptRequirement is longer needed, remove it.
- Parameters:
process (cwl_utils.parser.CommandLineTool | cwl_utils.parser.WorkflowStep | cwl_utils.parser.Workflow)
skip_command_line1 (bool)
- Return type:
None
- cwl_utils.expression_refactor.main()
Console entry point.
- Return type:
None
- cwl_utils.expression_refactor.run(args)
Collect the arguments and run.
- cwl_utils.expression_refactor.refactor(args)
Primary processing loop.
- Parameters:
args (argparse.Namespace)
- Return type: