rlmesh.adapters.CustomEncoding

classfrom rlmesh.adapters import CustomEncoding[source]

A rotation packing layered on a known native base encoding.

CustomEncoding(
    base: RotationEncoding,
    from_base: RotationTransform | str | None = None,
    to_base: RotationTransform | str | None = None,
    name: str = 'custom',
)

The two arms mirror the native encode/decode pair; each is required only on the side it is used (validated at resolve time). The packing must preserve the base width (ROTATION_DIMS[base]).

base

attribute[source]
base: RotationEncoding

The native encoding the field resolves as.

from_base

attribute[source]
from_base: RotationTransform | str | None

base -> custom, used when the encoding tags an observation (model) state component. An in-process callable (runs locally, serializes to a <local> marker), or a "module:callable" entrypoint string (a describe-only reference; its execution is deferred). None when action-only.

to_base

attribute[source]
to_base: RotationTransform | str | None

custom -> base, used when the encoding tags an action component. A callable or entrypoint string (see from_base). None when obs-only.

name

attribute[source]
name: str

Display name surfaced in Adapter.describe().

is_entrypoint

property[source]
property is_entrypoint: bool

Whether the arms are module:callable strings (serializable).

width

property[source]
property width: int

Element width of the base (and therefore custom) encoding.