Commit Graph

24 Commits

Author SHA1 Message Date
Christian Clauss
bb81e141ea Blacken the codebase (#2265) 2021-07-28 20:26:34 -04:00
RaghuSpaceRajan
6a0d8188e9 Importing wrappers in gym (#2040)
Otherwise, using gym.wrappers crashes code.
2020-09-11 15:07:51 -07:00
Tristan Deleu
c6a97e17ee Vectorized environments (#1513)
* Initial version of vectorized environments

* Raise an exception in the main process if child process raises an exception

* Add list of exposed functions in vector module

* Use deepcopy instead of np.copy

* Add documentation for vector utils

* Add tests for copy in AsyncVectorEnv

* Add example in documentation for batch_space

* Add cloudpickle dependency in setup.py

* Fix __del__ in VectorEnv

* Check if all observation spaces are equal in AsyncVectorEnv

* Check if all observation spaces are equal in SyncVectorEnv

* Fix spaces non equality in SyncVectorEnv for Python 2

* Handle None parameter in create_empty_array

* Fix check_observation_space with spaces equality

* Raise an exception when operations are out of order in AsyncVectorEnv

* Add version requirement for cloudpickle

* Use a state instead of binary flags in AsyncVectorEnv

* Use numpy.zeros when initializing observations in vectorized environments

* Remove poll from public API in AsyncVectorEnv

* Remove close_extras from VectorEnv

* Add test between AsyncVectorEnv and SyncVectorEnv

* Remove close in check_observation_space

* Add documentation for seed and close

* Refactor exceptions for AsyncVectorEnv

* Close pipes if the environment raises an error

* Add tests for out of order operations

* Change default argument in create_empty_array to np.zeros

* Add get_attr and set_attr methods to VectorEnv

* Improve consistency in SyncVectorEnv
2019-06-21 14:29:44 -07:00
pzhokhov
d11196a896 remove reraise logic (#1342)
* remove reraise logic - replace with re-raising import errors in the only place it is used

* remove reraise

* remove reset call from MountainCar constructor

* further remove reraise

* remove reraise import in classic_control/rendering.py
2019-03-07 15:58:26 -08:00
Peter Zhokhov
4ceff7dc09 fix KellyCoinFlipGeneralizedTest (sample from action_space after seed and reset, as action dimensions in it are also random) 2019-01-30 14:50:18 -08:00
Greg Brockman
812c46cbad Support kwargs in gym.make and export register (#1301)
* Support kwargs in gym.make

We avoided adding kwargs for a long time in order to encourage people
to statically register their environment definitions. However, over
time we've found a few important use-cases for kwargs, such as:

- Runtime-specific objects, such as which GPU to run the environment
  on
- Parametrized environments, which can have an infinite number of meaningful
  variants

The latter breaks the invariant that the environment ID alone
determines the semantics of the environment, but it's an advanced
use-case and such users should be able to manage this on their own.

* Export the register method so it's easier for external users to register environments

* Improve kwargs test
2019-01-29 13:37:43 -08:00
John Schulman
e689f93a42 remove deprecated behaviors (#1154) 2018-08-31 16:43:37 -07: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
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
Greg Brockman
dcac27ba74 Add GYM_NO_LOGGER_SETUP to disable logging config
This is useful for frameworks which are often used with Gym but don't
have a direct dependency on it
2017-05-07 17:32:12 -07:00
Tom Brown
443d509df7 Add __version__ (#490) 2017-02-03 16:51:00 -08:00
Tom Brown
d337f4e571 TimeLimit refactor with Monitor Simplification (#482)
* fix double reset, as suggested by @jietang

* better floors and ceilings

* add convenience methods to monitor

* add wrappers to gym namespace

* allow playing Atari games, with potentially more coming in the future

* simplify example in docs

* Move play out of the Env

* fix tests

* no more deprecation warnings

* remove env.monitor

* monitor simplification

* monitor simplifications

* monitor related fixes

* a few changes suggested by linter

* timestep_limit fixes

* keep track of gym env variables for future compatibility

* timestep_limit => max_episode_timesteps

* don't apply TimeLimit wrapper in make for VNC envs

* Respect old timestep_limit argument

* Pass max_episode_seconds through registration

* Don't include deprecation warnings yet
2017-02-01 13:10:59 -08:00
Greg Brockman
483c7805c0 Improve logging configuration 2016-10-01 19:35:41 -07:00
Greg Brockman
9a5c0fc63e Add support for extra loggers 2016-10-01 19:24:50 -07:00
Greg Brockman
934b2acbb7 Add benchmark support (#338)
* Warn if seed doesn't return a list

* Add preliminary BenchmarkRun support

* Add experimental benchmark registration

* Flesh out interface

* Add preliminary BenchmarkRun support

* Warn if seed doesn't return a list

* Add experimental benchmark registration

* Flesh out interface

* Make benchmarkrun upload recursive

* Add evaluation episodes

* Add benchmark scoring

* Tweak reward locations

* Tweak scoring

* Clear default metadata in Wrapper

* Improve scoring

* Expose registry; fix test

* Add initial_reset_timestamp

* Add back algorithm; fix tests
2016-09-23 01:04:26 -07:00
Greg Brockman
f30ff469b8 [WIP] Start adding Filter API (#329)
Expand Wrapper API
2016-09-04 00:38:03 -07:00
Greg Brockman
e305f95412 Add experimental Wrapper (#276) 2016-08-11 14:45:52 -07:00
MarCnu
9260271bef Replace StrictVersion by LooseVersion
Replaces the parsing function for the version comparison, to allow non standard versions. Remains unchanged for standard versions. http://epydoc.sourceforge.net/stdlib/distutils.version.LooseVersion-class.html
2016-05-20 17:40:17 +01:00
Greg Brockman
1d41486480 Improve dependency checking 2016-05-15 16:34:16 -07:00
Greg Brockman
f8429d825d Import descriptions and background 2016-05-09 16:35:23 -07:00
Luke
138c1eafad Merge pull request #44 from lukemetz/lm/errors
added missing import
2016-05-01 23:09:16 -04:00
Jonas Schneider
216f3ea8ce Sanity check that all dependencies are satisfied on __init__ 2016-04-30 22:38:09 -07:00
Greg Brockman
e8f2980603 Initial release. Hello world :). 2016-04-27 08:00:58 -07:00