EnsureInfoKeysWrapper
- class EnsureInfoKeysWrapper(env, required_keys: Iterable[str])[source]
Bases:
WrapperValidates that required keys are present in the info dict after reset and step.
Supports regex patterns for flexible key matching. Raises RuntimeError if any required pattern has no matching key.
- Parameters:
env – The Gymnasium environment to wrap.
required_keys – Iterable of regex patterns as strings. Each pattern must match at least one key in the info dict.
- Raises:
RuntimeError – If any required pattern has no matching key in info dict.