Python API
This page is generated from the docstrings of python/cfd_craft/__init__.py
and python/cfd_craft/__main__.py. Examples are in
guide chapter 11, the chapter on the Python binding.
Module cfd_craft
In-process, bounded CFD summaries; native CLI for fields and archives.
cfd_craft.__version__ is the installed distribution version.
CfdError
Subclass of ValueError.
Rejected input, including the shared native diagnostic report when present.
Attributes: diagnostics, report.
case_bytes(case)
Preserve raw JSON bytes for native duplicate/unknown-field validation.
describe()
Return native schemas, supported interface operations and build identity.
check(case)
Return the native preflight report: validity and coded diagnostics.
The checks are the CLI’s (strict parsing, geometry, sources, receptors and the host-memory estimate); the report omits the CLI’s geometry evidence and its {“check”: …} wrapper.
simulate(case, *, cancel_file=None)
Run in-process without the GIL and return a native summary dictionary.
Inspect termination, assessment, checks and experimental_validation before using receptor values. Incomplete runs remain results, not successes. Creating cancel_file stops cooperatively. Ctrl-C raises KeyboardInterrupt after the worker has stopped. Each call has its own bounded Rayon pool.
Console script
Summary-only Python CLI; the native CLI owns field/restart archives.
Run it as python -m cfd_craft COMMAND.
Options before the command: --version (prints the version).
| Command | Arguments |
|---|---|
check | case (Path) |
describe | none |
simulate | case (Path); --cancel-file (Path) |