* add test showing mismatch in flattened space dtype and flattened point dtype
* fix mismatch in flattened space dtype and flattened point dtype
* fix typo
* enhance test to detect when flattened dtype is incorrect
* fix incorrect flattened dtype
* remove inaccurate comment
* change flatten to always use space.dtype
* added testing for unflattened dtypes
* fix unflatten dtypes
* swtich flatten_space to use space.dtype for hardcoded space dtypes
* fix failure in python 3.5
* Add tests for gym.spaces.utils.
* Add docstrings to gym.spaces.utils.
* Remove some trailing whitespace.
* Add gym.spaces.utils.flatten_space.
The new function also is reexported as gym.spaces.flatten_space. It
improves the determination of observation_space in
gym.wrappers.FlattenObservation.
* Produce OrderedDict instead of dict in gym.spaces.unflatten().
`gym.spaces.Dict` is very particular about producing its samples as
`OrderedDict` in order preserve the order of its items. Hence,
`unflatten()` should reproduce this behavior.
* In test_utils.compare_nested, also verify order of OrderedDict items.
* Add examples to flatten_space() docstring.
* Document ``flatten(space, space.sample()) in flatten_space(space)``.
Co-authored-by: Nico Madysa <nico.madysa@tu-dresden.de>
* Respect the order of keys in a Dict's observation space when flattening
Prior to this change, the order of the key/values in the observation was used instead of the order in the Dict's observation space. unflatten already uses the order specified by the Dict's observation space.
* add tests for FlattenObservation