Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Release notes for v0.26.0
This release is aimed to be the last of the major API changes to the core API. All of the previously "turned off" changes of the base API (step termination / truncation, reset info, no seed function, render mode determined by initialization) are now expected by default. We still plan to make breaking changes to Gym itself, but to things that are very easy to upgrade (environments and wrappers), and things that aren't super commonly used (the vector API). Once those aspects are stabilized, we'll do a proper 1.0 release and follow semantic versioning. Additionally, unless something goes terribly wrong with this release and we have to release a patched version, this will be the last release of Gym for a while.
If you've been waiting for a "stable" release of Gym to upgrade your project given all the changes that have been going on, this is the one.
We also just wanted to say that we tremendously appreciate the communities patience with us as we've gone on this journey taking over the maintenance of Gym and making all of these huge changes to the core API. We appreciate your patience and support, but hopefully, all the changes from here on out will be much more minor.
Breaking backward compatibility
These changes are true of all gym's internal wrappers and environments but for environments not updated, we provide the
EnvCompatibility
wrapper for users to convert old gym v21 / 22 environments to the new core API. This wrapper can be easily applied ingym.make
andgym.register
through theapply_api_compatibility
parameters.Step
Termination / truncation - TheEnv.step
function returns 5 values instead of 4 previously (observations, reward, termination, truncation, info
). A blog with more details will be released soon to explain this decision. @arjun-kgEnv.reset
function returns two values (obs
andinfo
) with noreturn_info
parameter for gym wrappers and environments. This is important for some environments that provided action masking information for each actions which was not possible for resets. @balisujohnSeed
function - WhileEnv.seed
was a helpful function, this was almost solely used for the beginning of the episode and is added togym.reset(seed=...)
. In addition, for several environments like Atari that utilise external random number generators, it was not possible to set the seed at any time other thanreset
. Therefore,seed
is no longer expected to function within gym environments and is removed from all gym environments @balisujohnEnv.render
to not take any arguments and so all render arguments can be part of the environment's constructor i.e.,gym.make("CartPole-v1", render_mode="human")
. For more detail on the new API, see blog post @younikMajor changes
v25
, there was a change in the meaning of render modes, i.e. "rgb_array" returned a list of rendered frames with "single_rgb_array" returned a single frame. This has been reverted in this release with "rgb_array" having the same meaning as previously to return a single frame with a new mode "rgb_array_list" returning a list of RGB arrays. The capability to return a list of rendering observations achieved through a wrapper applied duringgym.make
. Rename "rgb_array" to "rgb_array_list" and "single_rgb_array" to "rgb_array" #3040 @pseudo-rnd-thoughts @youniksave_video
that usesmoviepy
to render a list of RGB frames and updatedRecordVideo
to use this function. This removes support for recordingansi
outputs. Add save_video util and deprecate RecordVideo in favor of it #3016 @younikRandomNumberGenerator
functions:rand
,randn
,randint
,get_state
,set_state
,hash_seed
,create_seed
,_bigint_from_bytes
and_int_list_from_bigint
have been removed. @balisujohnale-py
to0.8.0
which is compatibility with the new core APIEnvAPICompatibility
wrapper @RedTachyonMinor changes
Sequence
,Graph
andText
sample masking @pseudo-rnd-thoughtsmake
andregister
type hinting withentry_point
being a necessary parameter ofregister
. Updates the make and registration functions with better parameters and hints #3041 @pseudo-rnd-thoughts