Change the base spec names for nested observations (and actions) of Dict type.
The current scheme assigns all of them the generic name "observation" (or "action") which precludes referencing them by their name.
@@ -130,8 +130,7 @@ def _convert_to_spec(space: gym.Space, name: str = None) -> types.NestedSpec:
elif isinstance(space, spaces.Dict):
return {
- key: _convert_to_spec(value, name)
- for key, value in space.spaces.items()
+ key: _convert_to_spec(value, key) for key, value in space.spaces.items()
}
else:
