|
tin
1.5.9
|
Python interop supports test orchestration, model exploration, replay tooling, and notebook-style analysis around a machine definition. It is not the production runtime path. Production execution remains C++.
There are two Python-facing outputs:
Generate a Python model from machine JSON:
The generated module contains:
EventKind: enum of known events;Snapshot: active-state/context snapshot record;<MachineName>Model: small simulator with send(...) and snapshot().Example use:
The simulator is intentionally lightweight. It tracks active state and transition rows. It is useful for smoke tests, UI prototypes, CI checks, and tooling workflows that need to inspect behavior without compiling C++.
Generate a C++ binding skeleton:
The generated skeleton exposes:
EventKind: Python-visible event enum;StateKind: Python-visible active-state enum for runtime states;send_kind(...): typed event dispatch bridge;active_kind(): active-state query bridge.The skeleton expects a generated or hand-maintained C++ machine header. A product team should review the generated file, connect it to the desired C++ runtime object, and decide which context fields or side-effect endpoints should be visible to Python.
Use pure Python export for:
Use pybind11 generation for:
Keep safety-critical or deployment behavior in C++. Python should drive tests, analysis, and tool adapters around the C++ surface.
The quality suite covers:
pybind11 Python package is available.