Lossy by design: simulator handles and other rich objects (for example a
sapien.Pose) become their str() form rather than failing the serve
path. Accepted values pass through unchanged: None, bool, int,
float, str, bytes, and nested mappings/lists/tuples of them
(tuples become lists, as in the codec). NumPy scalars/arrays and namedtuples
are unwrapped the way the codec does (_asdict / tolist / item),
enums resolve to their value with a name fallback, and non-string
keys are stringified.
Parameters
| Name | Type | Description |
|---|
info | Mapping[str, Any] | The mapping to sanitize (e.g. a Gymnasium info dict). |
Returns
| Type | Description |
|---|
dict[str, Any] | A plain dict the native metadata codec accepts verbatim. |
Raises
| Type | Description |
|---|
TypeError | If info is not a mapping. |
ValueError | If info contains a reference cycle (the error names the key path). |