finesse.cyexpr module

Compiled symbolic expressions used internally via parameters and element workspaces.

This sub-module only exposes C code so can only be used by other Cython extensions. The symbolic expression struct cy_expr is used in workspaces (see ElementWorkspace) and parameter code (see Parameter) for quick evaluation of changing symbolic expressions.

The cy_expr struct, and associated functions, are wrappers around the C based math parsing and evaluation engine, tinyexpr.

finesse.cyexpr.parse_expr(op_str)[source]

Python-accessible function to parse a string.

Parameters

op_strstr

String containing operation, e.g., 0.0+1

Returns

resultfloat

Evaluated result of the expression

finesse.cyexpr.test_expr(op_str, value=None)[source]

Python accessible function to test the parsing of strings.

Parameters

op_strstr

String containing operation, e.g., 0.0+1

Returns

ex.exprboolean

False on parse fail