Runtime helpers¶
quiltwright.runtime
¶
Process-level defaults shared by more than one backend.
Nothing here knows about quilts, cameras, or a renderer. The courtesy
core cap is the one constant both POV-Ray and Cycles need so a quilt
does not take every core on the machine; the ffmpeg lookup is shared by
the quilt-video encoder and the HLD encoder; require_pyvista and
triple are the small helpers more than one module used to copy.
Part of Quiltwright -- https://github.com/Flux-Frontiers/quiltwright Author: Eric G. Suchanek, PhD
find_ffmpeg()
¶
Locate an ffmpeg binary: system PATH first, then imageio-ffmpeg's.
Returns:
| Type | Description |
|---|---|
str
|
Path to an ffmpeg executable. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no ffmpeg can be found. |
Source code in src/quiltwright/runtime.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
require_pyvista(fn_name)
¶
Raise a clear ImportError if pyvista is not installed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
fn_name
|
str
|
Public function name used in the error message. |
required |
Raises:
| Type | Description |
|---|---|
ImportError
|
If the |
Source code in src/quiltwright/runtime.py
45 46 47 48 49 50 51 52 53 54 55 56 | |
triple(v)
¶
Coerce a 3-vector -- list, tuple, NumPy array -- to a float 3-tuple.
tuple(v) types as tuple[float, ...], which is not a camera
coordinate. Unpacking states the arity and rejects a wrong-length
vector here rather than later.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
Iterable[float]
|
Any iterable of three reals. |
required |
Returns:
| Type | Description |
|---|---|
tuple[float, float, float]
|
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If v does not have exactly three components. |
Source code in src/quiltwright/runtime.py
59 60 61 62 63 64 65 66 67 68 69 70 71 | |