Skip to content

pyflightstream.script.motion (stable)

Generated from the docstrings at build time: every one of the 5 names in the __all__ of pyflightstream.script.motion has an entry below. The names a guide or an example uses come first; the others follow under Advanced.

Geometry/time provenance from emitted commands, never velocity-basis evidence.

Advanced

pyflightstream.script.motion.FRAME_AXES_TOLERANCE module-attribute

FRAME_AXES_TOLERANCE = 1e-08

pyflightstream.script.motion.MotionLedger

MotionLedger()

Follow explicit attachments; unknown motion never means fixed.

invalidate

invalidate(reason: str) -> None

Mark subsequent snapshots unproved after an untracked mutation.

follow

follow(
    name: str,
    bound: Mapping[str, Any],
    *,
    line: int,
    next_motion: int,
) -> None

Retain a validated command after argument binding and before entity creation.

snapshot

snapshot(
    placements: Mapping[int, Any],
    *,
    frame_count: int,
    boundary_count: int | None,
    version: str,
    length_unit: str | None,
    executable_sha256: str | None = None,
    build: str | None = None,
) -> dict[int, dict[str, Any]]

Return detached final placement and timing records, preserving unknowns.

pyflightstream.script.motion.SecondAxis module-attribute

SecondAxis = Annotated[
    tuple[float, float, float],
    AfterValidator(_second_axis_defines_a_system),
]

pyflightstream.script.motion.frame_axes_problem

frame_axes_problem(
    x_axis: Sequence[float],
    y_axis: Sequence[float],
    z_axis: Sequence[float] | None = None,
) -> str | None

Return why the axes do not define a coordinate system, or None when they do.

A coordinate system needs two directions that are finite, not zero, not parallel and orthogonal: the cosine of their angle within :data:FRAME_AXES_TOLERANCE, the test the motion ledger applies. Their lengths are free (they are directions), so (2, 0, 0) and (0, 1, 0) are accepted. A z_axis, when given, must point along the right-handed cross product of the other two.

Parameters:

Name Type Description Default
x_axis sequence of float

The two axes, three components each, in the reference frame.

required
y_axis sequence of float

The two axes, three components each, in the reference frame.

required
z_axis sequence of float

A third axis the caller states.

None

Returns:

Type Description
str or None

The reason, in words naming the axis at fault, or None.

Examples:

>>> frame_axes_problem((1.0, 0.0, 0.0), (0.0, 1.0, 0.0)) is None
True
>>> frame_axes_problem((1.0, 0.0, 0.0), (2.0, 0.0, 0.0))
'x_axis and y_axis are parallel, so they define no plane'

pyflightstream.script.motion.resolve_frame_motion

resolve_frame_motion(
    record: Mapping[str, Any],
    *,
    solver_identity: Mapping[str, Any],
) -> dict[str, Any]

Resolve recorded timing against exact native identity without mutating facts.

Parameters:

Name Type Description Default
record mapping of str to object

One frame-motion record of the ledger, with its trajectory and the reason its timing is unresolved.

required
solver_identity mapping of str to object

The run's solver identity, with its fs_build and recorded fs_exe_sha256.

required

Returns:

Type Description
dict of str to object

A copy of the record; where a measured proof exists for its version, unit and build, the trajectory gains its signed angular speed and step time origin and the record the proof. The record passed in is never changed.

Notes

A record whose timing stays unresolved keeps its state: known says the trajectory is stated, and the proof flags of the record say whether the timing of it was proved.