Skip to content

Commit

Permalink
Control f chaneg of gym to gymnasium
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts committed Sep 8, 2022
1 parent 2526810 commit 29b1316
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please try to provide a minimal example to reproduce the bug. Error messages and

**System Info**
Describe the characteristic of your environment:
* Describe how Gym was installed (pip, docker, source, ...)
* Describe how Gymnasium was installed (pip, docker, source, ...)
* What OS/version of Linux you're using. Note that while we will accept PRs to improve Window's support, we do not officially support it.
* Python version

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ the list of included, excluded and strict files can be found in pyproject.toml (
To run `pyright` for the project, run the pre-commit process (`pre-commit run --all-files`) or `pyright`

## Git hooks
The CI will run several checks on the new code pushed to the Gym repository. These checks can also be run locally without waiting for the CI by following the steps below:
The CI will run several checks on the new code pushed to the Gymnasium repository. These checks can also be run locally without waiting for the CI by following the steps below:
1. [install `pre-commit`](https://pre-commit.com/#install),
2. Install the Git hooks by running `pre-commit install`.

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

### Due to issues with the domain registration, the documentation has been moved to [https://www.gymlibrary.dev/](https://www.gymlibrary.dev/) as opposed to the old .ml address.

## Gym
## Gymnasium

Gym is an open source Python library for developing and comparing reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API. Since its release, Gym's API has become the field standard for doing this.
Gymnasium is an open source Python library for developing and comparing reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API. Since its release, Gym's API has become the field standard for doing this.

Gym documentation website is at [https://www.gymlibrary.dev/](https://www.gymlibrary.dev/), and you can propose fixes and changes to it [here](https://github.com/Farama-Foundation/gym-docs).

Expand Down Expand Up @@ -52,8 +52,8 @@ Gym keeps strict versioning for reproducibility reasons. All environments end in

## MuJoCo Environments

The latest "\_v4" and future versions of the MuJoCo environments will no longer depend on `mujoco-py`. Instead `mujoco` will be the required dependency for future gym MuJoCo environment versions. Old gym MuJoCo environment versions that depend on `mujoco-py` will still be kept but unmaintained.
To install the dependencies for the latest gym MuJoCo environments use `pip install gym[mujoco]`. Dependencies for old MuJoCo environments can still be installed by `pip install gym[mujoco_py]`.
The latest "\_v4" and future versions of the MuJoCo environments will no longer depend on `mujoco-py`. Instead `mujoco` will be the required dependency for future gymnasiumMuJoCo environment versions. Old gymnasiumMuJoCo environment versions that depend on `mujoco-py` will still be kept but unmaintained.
To install the dependencies for the latest gymnasium MuJoCo environments use `pip install gym[mujoco]`. Dependencies for old MuJoCo environments can still be installed by `pip install gym[mujoco_py]`.

## Citation

Expand Down
8 changes: 4 additions & 4 deletions gymnasium/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

if sys.version_info[0:2] == (3, 6):
warn(
"Gym minimally supports python 3.6 as the python foundation not longer supports the version, please update your version to 3.7+"
"Gymnasium minimally supports python 3.6 as the python foundation not longer supports the version, please update your version to 3.7+"
)

ObsType = TypeVar("ObsType")
Expand All @@ -33,7 +33,7 @@


class Env(Generic[ObsType, ActType]):
r"""The main OpenAI Gym class.
r"""The main Gymnasium class.
It encapsulates an environment with arbitrary behind-the-scenes dynamics.
An environment can be partially or fully observed.
Expand Down Expand Up @@ -370,7 +370,7 @@ def __init__(self, env):
def observation(self, obs):
return obs["target"] - obs["agent"]
Among others, Gym provides the observation wrapper :class:`TimeAwareObservation`, which adds information about the
Among others, Gymnasium provides the observation wrapper :class:`TimeAwareObservation`, which adds information about the
index of the timestep to the observation.
"""

Expand Down Expand Up @@ -452,7 +452,7 @@ def action(self, act):
print(wrapped_env.action_space) #Discrete(4)
Among others, Gym provides the action wrappers :class:`ClipAction` and :class:`RescaleAction`.
Among others, Gymasnium provides the action wrappers :class:`ClipAction` and :class:`RescaleAction`.
"""

def step(self, action):
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/envs/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def load_env_plugins(entry_point: str = "gymnasium.envs") -> None:
finally:
if attr is None:
raise error.Error(
f"Gym environment plugin `{module}` must specify a function to execute, not a root module"
f"Gymnasium environment plugin `{module}` must specify a function to execute, not a root module"
)

context = namespace(plugin.name)
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/spaces/sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
"""
assert isinstance(
space, gymnasium.Space
), f"Expects the feature space to be instance of a gym Space, actual type: {type(space)}"
), f"Expects the feature space to be instance of a gymnasium Space, actual type: {type(space)}"
self.feature_space = space
super().__init__(
None, None, seed # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions gymnasium/vector/async_vector_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def __init__(
except CustomSpaceError:
raise ValueError(
"Using `shared_memory=True` in `AsyncVectorEnv` "
"is incompatible with non-standard Gym observation spaces "
"is incompatible with non-standard Gymnasium observation spaces "
"(i.e. custom spaces inheriting from `gymnasium.Space`), and is "
"only compatible with default Gym spaces (e.g. `Box`, "
"only compatible with default Gymnasium spaces (e.g. `Box`, "
"`Tuple`, `Dict`) for batching. Set `shared_memory=False` "
"if you use custom observation spaces."
)
Expand Down
12 changes: 6 additions & 6 deletions gymnasium/vector/utils/shared_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def create_shared_memory(
raise CustomSpaceError(
"Cannot create a shared memory for space with "
f"type `{type(space)}`. Shared memory only supports "
"default Gym spaces (e.g. `Box`, `Tuple`, "
"default Gymnasium spaces (e.g. `Box`, `Tuple`, "
"`Dict`, etc...), and does not support custom "
"Gym spaces."
"Gymnasium spaces."
)


Expand Down Expand Up @@ -103,9 +103,9 @@ def read_from_shared_memory(
raise CustomSpaceError(
"Cannot read from a shared memory for space with "
f"type `{type(space)}`. Shared memory only supports "
"default Gym spaces (e.g. `Box`, `Tuple`, "
"default Gymnasium spaces (e.g. `Box`, `Tuple`, "
"`Dict`, etc...), and does not support custom "
"Gym spaces."
"Gymnasium spaces."
)


Expand Down Expand Up @@ -159,9 +159,9 @@ def write_to_shared_memory(
raise CustomSpaceError(
"Cannot write to a shared memory for space with "
f"type `{type(space)}`. Shared memory only supports "
"default Gym spaces (e.g. `Box`, `Tuple`, "
"default Gymnasium spaces (e.g. `Box`, `Tuple`, "
"`Dict`, etc...), and does not support custom "
"Gym spaces."
"Gymnasium spaces."
)


Expand Down
2 changes: 1 addition & 1 deletion gymnasium/wrappers/step_api_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(self, env: gymnasium.Env, output_truncation_bool: bool = True):
self.output_truncation_bool = output_truncation_bool
if not self.output_truncation_bool:
deprecation(
"Initializing environment in old step API which returns one bool instead of two."
"Initializing environment in (old) done step API which returns one bool instead of two."
)

def step(self, action):
Expand Down
2 changes: 1 addition & 1 deletion py.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# A Dockerfile that sets up a full Gym install with test dependencies
# A Dockerfile that sets up a full Gymnasium install with test dependencies
ARG PYTHON_VERSION
FROM python:$PYTHON_VERSION

Expand Down

0 comments on commit 29b1316

Please sign in to comment.