Skip to content

Commit

Permalink
remove AtariPreprocessing as it is merged to gym officially
Browse files Browse the repository at this point in the history
see this PR: openai/gym#1455


Former-commit-id: d6377e7ccf525c283be2d39f3a3e4ab348ae986b [formerly a2edba1f0364f52f172bb41d29ce2ff7bab4d835]
Former-commit-id: 613183f5e316a540ffc7990b1972309df7bd5f6d
  • Loading branch information
zuoxingdong committed May 14, 2019
1 parent e1e288f commit c83f359
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 162 deletions.
4 changes: 0 additions & 4 deletions docs/source/envs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ lagom.envs
:members:

.. autofunction:: make_vec_env

.. autoclass:: AtariPreprocessing
:members:

.. autofunction:: make_atari

Wrappers
--------------
Expand Down
3 changes: 0 additions & 3 deletions lagom/envs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@
from .vec_env import VecEnv
from .vec_env import VecEnvWrapper
from .make_vec_env import make_vec_env

from .atari import AtariPreprocessing
from .atari import make_atari
137 changes: 0 additions & 137 deletions lagom/envs/atari.py

This file was deleted.

18 changes: 0 additions & 18 deletions test/test_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from lagom.envs import unflatten
from lagom.envs import make_vec_env
from lagom.envs import VecEnv
from lagom.envs import make_atari
from lagom.envs.wrappers import get_wrapper
from lagom.envs.wrappers import get_all_wrappers
from lagom.envs.wrappers import ClipAction
Expand Down Expand Up @@ -82,23 +81,6 @@ def test_space_utils():
assert sample['score'] == _sample['score']
assert np.allclose(sample['sensors']['position'], _sample['sensors']['position'])
assert np.allclose(sample['sensors']['velocity'], _sample['sensors']['velocity'])


@pytest.mark.parametrize('env_id', ['Pong', 'Breakout', 'SpaceInvaders'])
def test_make_atari(env_id):
env = make_atari(env_id)
assert env.observation_space.shape == (4, 84, 84)
assert np.allclose(env.observation_space.low, 0)
assert np.allclose(env.observation_space.high, 255)
obs = env.reset()
for _ in range(200):
obs, reward, done, info = env.step(env.action_space.sample())
obs = np.asarray(obs)
assert obs.shape == (4, 84, 84)
assert obs.max() <= 255
assert obs.min() >= 0
if done:
break


@pytest.mark.parametrize('env_id', ['CartPole-v0', 'Pendulum-v0'])
Expand Down

0 comments on commit c83f359

Please sign in to comment.