Commit Graph

82 Commits

Author SHA1 Message Date
pzhokhov
5861d95ecd fix #1425 (#1459)
* fixes #1266

* test for correct observation space keys in GoalEnv

* fix import leading to test failures

* fix test failures
2019-05-10 15:00:01 -07:00
Xingdong Zuo
e801ccfdb0 [Update core.py] Remove underscore methods and its deprecation warning (#1320)
* Update core.py

* Update core.py

* Update core.py

* Update core.py

* Update core.py

* Update core.py
2019-05-03 14:53:31 -07:00
Yulun Li
3394e24572 Bugfix: wrapper should make spec optional for backward compatibility (#1424) 2019-04-08 19:29:13 -07:00
Xingdong Zuo
5744b25a6c [Update core.py]: support Wrapper for registering global methods with nested wrapping (#1347)
* Update core.py

* Update core.py
2019-03-25 12:11:53 -07:00
Xingdong Zuo
97a416fa14 [Update core.py] Remove unnecessary parts (#1406)
* Update core.py

* Update core.py
2019-03-25 10:23:14 -07:00
Sid Mysore
52e94a2b50 kwargs on reset for Reward and Action Wrapper (#1340) 2019-03-01 14:15:39 -08:00
Will Douglas
b5a3367fd5 Finish removing close as an option from render (#1009)
This cleans up some leftover changes after PR #836
2019-02-25 17:01:54 -07:00
Tom Alcorn
6c7e22245a Implement context handler protocol for Env (#1012)
This enables writing
```
import gym

with gym.make(...) as env:
    ...
```
without the need to remember to call `env.close()` later.
2019-02-25 16:53:58 -07:00
Xingdong Zuo
6497c9f1c6 Delete prng.py (#1196)
* Delete prng.py

Since it seems like this seeding function is rarely used.

* Update __init__.py

* Update kellycoinflip.py

* Update core.py

* Update box.py

* Update discrete.py

* Update multi_binary.py

* Update multi_discrete.py

* Update test_determinism.py

* Update test_determinism.py

* Update test_determinism.py

* Update core.py

* Update box.py

* Update test_determinism.py

* Update core.py

* Update box.py

* Update discrete.py

* Update multi_binary.py

* Update multi_discrete.py

* Update dict_space.py

* Update tuple_space.py

* Update core.py

* Create space.py

* Update __init__.py

* Update __init__.py

* Update box.py

* Update dict_space.py

* Update discrete.py

* Update dict_space.py

* Update multi_binary.py

* Update multi_discrete.py

* Update tuple_space.py

* Update discrete.py

* Update box.py

* Update dict_space.py

* Update multi_binary.py

* Update multi_discrete.py

* Update tuple_space.py

* Update multi_discrete.py

* Update multi_binary.py

* Update dict_space.py

* Update box.py

* Update test_determinism.py

* Update kellycoinflip.py

* Update space.py
2019-01-30 13:39:55 -08:00
Balázs Kossovics
e8349e3668 Fix in keyword with Spaces (#1261)
Binding `__contains__` to the Space class' contains method this way prevents overriding it in subclasses, which leads to `NotImplementedException`s when trying to do things like `2 in gym.spaces.Discrete(2)`.
2019-01-28 14:52:41 -08:00
Alok Singh
6332d4f113 rm unnecessary __contains__ duplicate code (#1147)
`contains` really should not exist when it does exactly what the builtin
magic method `__contains__` was meant for, but that would break backward
compatibility.
2018-08-28 10:51:28 -07:00
Alex Nichol
5404b39d06 remove double-wrap warning (#1061)
* remove double-wrap warning

* remove double-wrap tests
2018-06-04 17:00:27 -04:00
Adam Gleave
0e1fce13d2 Make Wrapper pass-through optional arguments to render (#1055) 2018-05-30 10:38:58 +02:00
Greg Brockman
28df2b1a21 Speed up time for import gym (#1020)
* Improve default import time from 750ms -> 73ms on 2016 Macbook pro

* Support code which expects gym.spaces.foo to work without a direct import of gym.spaces
2018-05-04 09:24:30 -07:00
Matthias Plappert
78c416ef7b New robotics environments (#912) 2018-02-26 17:35:07 +01:00
Glenn Powell
eeabe4f91f Reverting all commits to gym (#887) 2018-02-12 15:17:04 -08:00
Glenn Powell
148e2ec048 Generic interface to propagate custom commands through wrapper/env stack (#873)
* Spaces have a compatible method which determines if 2 Spaces are of the same shape, ignoring bounds.

* Added a command interface for Env/Wrappers

* Made command interface more aligned with gym codebase.  Added CommandWrapper helper class.

* Refactored method names from command to event/broadcast
2018-02-09 14:51:24 -08:00
Szymon Sidor
e775e5a333 add default arguments to gym.Spaces constructor for backwards compatibility 2018-02-08 16:46:25 -08:00
Glenn Powell
7682f7117f Glenn space compatibility (#872)
* Spaces have a compatible method which determines if 2 Spaces are of the same shape, ignoring bounds.

* Comparing compatibility of a Space with None will result in False now
2018-02-08 13:09:28 -08:00
Glenn Powell
2b2460b5c0 Spaces have a compatible method which determines if 2 Spaces are of the same shape, ignoring bounds. (#871) 2018-02-08 12:53:47 -08:00
John Schulman
4c460ba6c8 Cleanup, removal of unmaintained code (#836)
* add dtype to Box

* remove board_game, debugging, safety, parameter_tuning environments

* massive set of breaking changes
- remove python logging module
- _step, _reset, _seed, _close => non underscored method
- remove benchmark and scoring folder

* Improve render("human"), now resizable, closable window.

* get rid of default step and reset in wrappers, so it doesn’t silently fail for people with underscore methods

* CubeCrash unit test environment

* followup fixes

* MemorizeDigits unit test envrionment

* refactored spaces a bit
fixed indentation
disabled test_env_semantics

* fix unit tests

* fixes

* CubeCrash, MemorizeDigits tested

* gym backwards compatibility patch

* gym backwards compatibility, followup fixes

* changelist, add spaces to main namespaces

* undo_logger_setup for backwards compat

* remove configuration.py
2018-01-25 18:20:14 -08:00
John Schulman
dbae2538e8 only close env if it exists (otherwise we get bad stack traces when construction fails) 2017-09-02 18:10:50 -07:00
John Schulman
c13490db86 forward **reset through wrappers 2017-09-02 18:09:44 -07:00
John Schulman
2b30434d14 Make sure env.spec always exists and is valid. (#621)
* Make sure env.spec always exists and is valid. Previously there was an error when you tried to get the string representation of an unregistered env.

* update changelist
2017-06-16 16:35:03 -07:00
Trevor Blackwell
2a0a2a3a2b Forward spec down the tree, rather than copy at init time, since it can be set after wrapping 2017-03-09 18:16:26 -08:00
John Schulman
ed35158524 simplify renderer closing 2017-03-05 20:11:24 -08:00
Greg Brockman
3174039cbf Revert render change for now 2017-03-05 16:30:04 -08:00
Tom Brown
842de12611 Clarify instructions for resolving env.configure related issues 2017-03-05 14:11:43 -08:00
John Schulman
0ee49635f1 add *args, **kwargs to (non-functional) configure 2017-03-05 13:17:32 -08:00
John Schulman
387f14d381 remove configure, simplify core.py 2017-03-05 12:00:51 -08:00
John Schulman
9f23363e17 minor, spelling 2017-02-04 23:35:38 -08:00
John Schulman
518f4b7c4b change auto-configure behavior to unbreak universe 2017-01-04 17:29:32 -08:00
John Schulman
1a06fe0d9b get rid of auto reset 2017-01-03 23:51:25 -08:00
John Schulman
a67653ccb1 cartpole fix (#457)
minor fixes related to configure() and cartpole
2017-01-03 23:19:14 -08:00
Tom Brown
69c1cda01c Downgrade DoubleWrap error to warning 2016-12-28 13:08:47 -08:00
Tom Brown
85da4b7877 Improve error message 2016-12-28 13:08:47 -08:00
Jie Tang
a81a631b2e Add error when wrapping after configure 2016-12-28 13:08:47 -08:00
Tom Brown
3ad93f62fd Improve deprecation message 2016-12-27 20:02:33 -08:00
Tom Brown
2d44ed4968 Add Monitored wrapper (#434)
* Add WIP Monitored wrapper

* Remove irrelevant render after close monitor test

* py27 compatibility

* Fix test_benchmark

* Move Monitored out of wrappers __init__

* Turn Monitored into a function that returns a Monitor class

* Fix monitor tests

* Remove deprecated test

* Remove deprecated utility

* Prevent duplicate wrapping, add test

* Fix test

* close env in tests to prevent writing to nonexistent file

* Disable semisuper tests

* typo

* Fix failing spec

* Fix monitoring on semisuper tasks

* Allow disabling of duplicate check

* Rename MonitorManager

* Monitored -> Monitor

* Clean up comments

* Remove cruft
2016-12-23 16:21:42 -08:00
Greg Brockman
faed1c6546 Get rid of separate async semantics 2016-11-13 19:42:57 -08:00
Greg Brockman
b7e53c371d Update ObservationWrapper for new async semantics 2016-11-07 14:30:06 -08:00
damodei
5afbb71929 add reverse action filter for demos 2016-10-14 22:07:47 -07:00
Greg Brockman
3c95d3af8f Clear default metadata in Wrapper
Closes #340
2016-09-09 10:13:53 -07:00
Greg Brockman
0278f273fa Revert wrappers to having their own monitor
Otherwise you end up with multiple calls to the same monitor at each
step.
2016-09-05 16:00:31 -07:00
Greg Brockman
a6ec54415c By default, Wrappers shouldn't have their own monitors 2016-09-05 10:30:54 -07:00
Greg Brockman
9b8472726c Check for hasattr _monitor before invoking monitor 2016-09-04 19:41:11 -07:00
Greg Brockman
6c6bd391a5 Add non-underscore methods for Wrappers 2016-09-04 01:44:20 -07:00
Greg Brockman
f30ff469b8 [WIP] Start adding Filter API (#329)
Expand Wrapper API
2016-09-04 00:38:03 -07:00
Olivier Sigaud
c97551e8e5 added continuous mountain car v0 (#306)
* added continuous mountain car v0

* spotted that the action should be a vector, not a scalar

* fixed bug on action format

* bug fixed in scoreboard registering

* the observation (aka state) should be a numpy array

* added comment on reward range as requested
2016-08-24 14:10:58 -07:00
Greg Brockman
e2c9e84a51 Bump version 2016-08-17 15:55:14 -07:00