"""A tiny application adapter for synthetic absolute joint positions."""

import math


def named_targets(values, action_joints):
    """Map a training-order vector to names; no connection, scaling or motion."""
    if not action_joints or len(set(action_joints)) != len(action_joints):
        raise ValueError("action joint names must be nonempty and unique")
    if len(values) != len(action_joints):
        raise ValueError("action width differs from joint order")
    targets = {}
    for name, value in zip(action_joints, values, strict=True):
        if isinstance(value, bool) or not isinstance(value, (int, float)) or not math.isfinite(value):
            raise ValueError("absolute positions must be finite numbers")
        targets[name] = float(value)
    return targets
