cwl_utils.expression

CWL Expression parsing.

Attributes

OLD_ESCAPE_CWL_VERSIONS

Classes

t

Tokens.

Functions

scanner(scan)

Find JS relevant punctuation in a string.

evaluator(js_engine, ex, obj, jslib, fullJS, **kwargs)

interpolate(scan, rootvars[, jslib, fullJS, ...])

Interpolate and evaluate.

jshead(engine_config, rootvars)

Make sure all the byte strings are converted to str in rootvars dict.

needs_parsing(snippet)

do_eval(ex, jobinput, requirements, outdir, tmpdir, ...)

Evaluate the given CWL expression, in context.

Module Contents

cwl_utils.expression.OLD_ESCAPE_CWL_VERSIONS: Final[collections.abc.Container[str]] = ('v1.0', 'v1.1.0-dev1', 'v1.1', 'v1.2.0-dev1', 'v1.2.0-dev2', 'v1.2.0-dev3')
class cwl_utils.expression.t(*args, **kwds)

Bases: enum.Enum

Inheritance diagram of cwl_utils.expression.t

Tokens.

DEFAULT = 0
DOLLAR = 1
PAREN = 2
BRACE = 3
SINGLE_QUOTE = 4
DOUBLE_QUOTE = 5
BACKSLASH = 6
cwl_utils.expression.scanner(scan)

Find JS relevant punctuation in a string.

Parameters:

scan (str)

Return type:

tuple[int, int] | None

cwl_utils.expression.evaluator(js_engine, ex, obj, jslib, fullJS, **kwargs)
Parameters:
Return type:

cwl_utils.types.CWLOutputType | None

cwl_utils.expression.interpolate(scan, rootvars, jslib='', fullJS=False, strip_whitespace=True, escaping_behavior=2, convert_to_expression=False, js_engine=None, **kwargs)

Interpolate and evaluate.

Note: only call with convert_to_expression=True on CWL Expressions in $() form that need interpolation.

Parameters:
Return type:

cwl_utils.types.CWLOutputType | None

cwl_utils.expression.jshead(engine_config, rootvars)

Make sure all the byte strings are converted to str in rootvars dict.

Parameters:
Return type:

str

cwl_utils.expression.needs_parsing(snippet)
Parameters:

snippet (Any)

Return type:

bool

cwl_utils.expression.do_eval(ex, jobinput, requirements, outdir, tmpdir, resources, context=None, timeout=default_timeout, strip_whitespace=True, cwlVersion='', **kwargs)

Evaluate the given CWL expression, in context.

Parameters:
Return type:

cwl_utils.types.CWLOutputType | None