Skip to content

Python backend

opulse.runtime.python_backend

Run generated operator code with exec in one shared namespace.

Base operations are bound from :class:~opulse.core.semantics.Semantics; the hand-written op_compute_func strings stored for base operators in old JSON files are ignored, so there is exactly one implementation of the arithmetic. Every other operator's code is executed into the same globals dict, so a function can call any other operator (or itself) by name regardless of load order.

PythonRuntime

evaluate

evaluate(operator: Operator) -> Callable[..., tuple]

(*args) -> (value, base_ops, calls).

base_bindings

base_bindings(
    operator: Operator, semantics: Semantics
) -> dict[str, Callable]

Namespace entries for one base operator: value, count and evaluator.