Skip to content

TrajectoryFile ​

python
TrajectoryFile(trajectory_file: DotNetTrajectoryFile) -> None

Python wrapper around OakEmu's end-of-episode TrajectoryFile.

Initialize the wrapper.

Parameters:

  • trajectory_file (TrajectoryFile) – The underlying .NET TrajectoryFile.

Source

Properties ​

action_map ​

python
action_map: tuple[str, ...]

Return the action names stored in the trajectory map.

Returns:

  • tuple[str, ...] – The action names as a tuple.

Source

actions ​

python
actions: bytes

Return the action indices up to the last interesting marker.

Returns:

  • bytes – The action indices as one contiguous byte buffer.

Source

captured_expression_labels ​

python
captured_expression_labels: tuple[str, ...]

Return the captured value labels, in marker value order.

Returns:

  • tuple[str, ...] – The labels as a tuple.

Source

emulator_type ​

python
emulator_type: int

Return the OakEmu emulator type.

Returns:

  • int – The emulator type value.

Source

end_state ​

python
end_state: bytes | None

Return the snapshot at the last interesting marker, if present.

Returns:

  • bytes | None – The last interesting-marker snapshot, or None.

Source

end_values ​

python
end_values: dict[str, int]

Return the values captured at the last interesting marker.

Returns:

  • dict[str, int] – The last interesting-marker values dictionary.

Source

episode_actions ​

python
episode_actions: bytes

Return the full episode action indices.

Returns:

  • bytes – The full episode action indices as one contiguous byte buffer.

Source

episode_end_state ​

python
episode_end_state: bytes

Return the snapshot at the end marker.

Returns:

  • bytes – The end-of-episode snapshot bytes.

Source

episode_end_values ​

python
episode_end_values: dict[str, int]

Return the values captured at the end marker.

Returns:

  • dict[str, int] – The episode-end values dictionary.

Source

frame_skip ​

python
frame_skip: int

Return the frame-skip value stored in the trajectory.

Returns:

  • int – The frame-skip value.

Source

frame_stack_definitions ​

python
frame_stack_definitions: tuple[FrameStackDefinition, ...]

Return the frame stack definitions stored in the episode block.

Returns:

  • tuple[FrameStackDefinition, ...] – The definitions, empty when the trajectory carries no frame stacks.

Source

has_end_state ​

python
has_end_state: bool

Return whether the episode contains at least one interesting marker.

Returns:

  • bool – True when an interesting marker is present.

Source

initial_state ​

python
initial_state: bytes

Return the serialised emulator state at the start of the episode.

Returns:

  • bytes – The initial emulator state bytes.

Source

interesting_markers ​

python
interesting_markers: tuple[TrajectoryMarker, ...]

Return only interesting-point markers.

Returns:

  • tuple[TrajectoryMarker, ...] – The interesting markers as Python dataclasses.

Source

markers ​

python
markers: tuple[TrajectoryMarker, ...]

Return the ordered markers emitted for the episode.

Returns:

  • tuple[TrajectoryMarker, ...] – The markers as Python dataclasses.

Source

screen_type ​

python
screen_type: int

Return the OakEmu screen type.

Returns:

  • int – The screen type value.

Source

start_values ​

python
start_values: dict[str, int]

Return the values captured at the start marker.

Returns:

  • dict[str, int] – The start values dictionary.

Source

trigger_definitions ​

python
trigger_definitions: tuple[TrajectoryTriggerDefinition, ...]

Return the trigger definitions stored in the episode block.

Returns:

  • tuple[TrajectoryTriggerDefinition, ...] – The trigger definitions as Python dataclasses.

Source

Methods ​

from_dotnet ​

python
from_dotnet(trajectory_file: DotNetTrajectoryFile) -> TrajectoryFile

Wrap an existing .NET TrajectoryFile.

Parameters:

  • trajectory_file (TrajectoryFile) – The .NET object to wrap.

Returns:

  • TrajectoryFile – The wrapped trajectory.

Source

interesting_segments ​

python
interesting_segments() -> tuple[TrajectorySegment, ...]

Split the full episode into boundary-to-boundary segments ending at interesting or final markers.

Adjacent interesting markers with no intervening action block are treated as the same boundary and do not create zero-length segments.

Returns:

  • tuple[TrajectorySegment, ...] – The derived interesting segments in episode order.

Source

load ​

python
load(path: str | PathLike) -> TrajectoryFile

Load a trajectory file from disk. Compressed files, for example .oet.zst, are decompressed automatically.

Parameters:

  • path (str | PathLike) – Source path.

Returns:

  • TrajectoryFile – The loaded wrapper.

Source

save ​

python
save(path: str | PathLike) -> None

Save the trajectory file.

Parameters:

  • path (str | PathLike) – Destination path.

Source