Commit Graph

54 Commits

Author SHA1 Message Date
Rohan138
a7b6462136 Updated registration.py (#2375)
* Updated registration.py

* Blacken
2021-09-01 14:27:01 -04:00
J K Terry
150404104a Move Algorithmic Environments to Third Party Repo (#2344)
* try removing algorithmic environments

* fix tests

* algorithmic environments

* Moved algorithmic environments (#2363)

* Moved algorithmic environments

Moved algorithmic environments

Moved algorithmic environments

* blacken

* remove bad link

Co-authored-by: Rohan138 <66227218+Rohan138@users.noreply.github.com>
2021-08-27 09:48:24 -04:00
J K Terry
78d2b512d8 redo black (#2272) 2021-07-29 15:39:42 -04:00
Justin Terry
e9d2c41f2b redo black 2021-07-29 12:42:48 -04:00
Christian Clauss
bb81e141ea Blacken the codebase (#2265) 2021-07-28 20:26:34 -04:00
Diego Ferigo
10f3ffe680 Update stored spec object with kwargs (#1866)
* Update stored spec object with kwargs

* Add unit test
2020-04-24 16:49:41 -05:00
Christian Clauss
b7bd6bd1cc Typo: enviroment --> environment (#1828)
* Typo: enviroment --> environment

* Typo: information does not have a plural form in English
2020-03-06 16:37:23 -05:00
Xingdong Zuo
a99e8d153e [Update registration.py]: Clean-up of unused arguments (#1626)
* Update registration.py

* Update registration.py
2019-12-06 16:04:44 +01:00
Jesse Farebrother
dc91f434f8 Expose entry_point on EnvSpec 2019-07-19 14:36:57 -07:00
Julian Stastny
239aaf14ce Update registration.py (#1475) 2019-05-24 15:55:40 -07:00
Xingdong Zuo
c7bae99a06 [Update registration.py]: Remove unused args (#1429)
* Update registration.py

* Update registration.py
2019-04-26 14:30:14 -07:00
Xingdong Zuo
85a5372a19 [Update time_limit.py]: explicit information to distinguish done by passing limit (#1402)
* Update time_limit.py

* Update time_limit.py

* Update time_limit.py

* Update time_limit.py

* Update registration.py

* Update registration.py

* Update time_limit.py

* Update time_limit.py

* Update time_limit.py

* Update time_limit.py
2019-04-19 14:20:26 -07:00
iory
c6a3dedc4b [envs/registration.py] Fixed import module (#1398)
* [envs/registration.py] Fixed warnings import

* [envs/registration.py] Fixed ModuleNotFounderror

* [envs/registration.py] Modified ModuleNotFoundError to ImportError for python2.7
2019-03-23 14:27:58 -07:00
pzhokhov
93c5ca0d3d fixes #1066 (#1379) 2019-03-18 13:02:22 -07:00
Christopher Hesse
c34716645a import modules when specified to gym.make (#1344)
* import modules when specified to gym.make

* update docs
2019-03-08 14:50:32 -08:00
Kohki Mametani
72e3f9d32f Fixed typo (#656) 2019-03-07 12:21:57 -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
Evgeniy Zheltonozhskiy
dc27a6f0a1 Replace deprecated load(False) with resolve() (#942) 2018-11-28 08:25:27 -08:00
Vitchyr Pong
10e53654cd Support kwargs for callable entry point (#1162) 2018-09-16 08:41:01 -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
Greg Brockman
1f4f625831 Add _gym_disable_underscore_compat to force-disable compatibility mode (#957)
Advanced users may have their own _step/_reset methods
2018-03-18 17:49:39 -07: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
5af5b7958a allow registering a callable 2017-09-18 11:25:39 -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
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
Tom Brown
4cec14144b Add setter for backwards compat (#446)
* Add setter for backwards compat

* Fix ordering and preserver backwards compat
2016-12-28 15:38:55 -08:00
Tom Brown
133f1fdfdf Add timestep_limit property to EnvSpec to preserver backwards compat 2016-12-28 15:16:42 -08:00
Tom Brown
68c66b9a00 Kill timestep_limit 2016-12-28 13:08:47 -08:00
Greg Brockman
53c074ab3b Add period to valid env IDs 2016-11-11 21:09:25 -08:00
Greg Brockman
6db689a0ca Expand env-id format 2016-10-31 11:36:45 -07:00
catherio
aa3fad8e00 Refactor 2016-09-28 10:24:44 -07:00
catherio
3cd5b4038b No empty dicts or lists as default values
Apparently python does not play nicely with the empty dict (or the
empty list for that matter) as a default value:
http://stackoverflow.com/questions/5712904/empty-dictionary-as-default-value-for-keyword-argument-in-python-function-dicti
2016-09-27 23:13:11 -07:00
catherio
0900e7d2fd Tags are now a dict; make sure to initialize as a dict, not a list 2016-09-27 22:59:39 -07:00
Greg Brockman
53eca9c55c Add optional tags 2016-09-04 01:44:27 -07:00
John Schulman
dbf7e51023 define actual methods for register, make, spec 2016-08-20 16:05:50 -07:00
Greg Brockman
ee02589eec Don't have envs be aware of wrappers (#296)
You can always achive the same effect by exposing a wrapping function:

def MyEnv():
  return MyWrapper(MyUnwrappedEnv())
2016-08-17 15:16:45 -07:00
Greg Brockman
09082c9e5c Tweak Wrapper implementation (#291)
* Tweak README and don't use __new__ for wrapper

The extra 'env' argument means that Wrapper authors with a custom
__init__ need to think about the parent signature anyway, so there's
not as much benefit to adding the more surprising __new__.

* Add support for registering wrappers for the official environment
2016-08-13 19:24:48 -07:00
Greg Brockman
e305f95412 Add experimental Wrapper (#276) 2016-08-11 14:45:52 -07:00
Greg Brockman
2aa03d6088 Add configure method to Env, and support multiple displays in CartPole (#175)
* Add configure method to Env, and support multiple displays in CartPole

This allows people to pass runtime specification which doesn't affect
the environment semantics to environments created via `make`.

Also include an example of setting the display used for CartPole

* Provide full configure method

* Allow environments to require configuration

* Don't take arguments in make
2016-06-12 20:56:21 -07:00
Jie Tang
9791a185a9 Merge simple environments for debugging agents (PR #124) 2016-05-31 00:25:50 -07:00
Greg Brockman
4d11ccbb1a Make nondeterministic into a public property 2016-05-29 09:34:36 -07:00
Greg Brockman
58e6aa95e5 [WIP] add support for seeding environments (#135)
* Make environments seedable

* Fix monitor bugs

- Set monitor_id before setting the infix. This was a bug that would yield incorrect results with multiple monitors.
- Remove extra pid from stats recorder filename. This should be purely cosmetic.

* Start uploading seeds in episode_batch

* Fix _bigint_from_bytes for python3

* Set seed explicitly in random_agent

* Pass through seed argument

* Also pass through random state to spaces

* Pass random state into the observation/action spaces

* Make all _seed methods return the list of used seeds

* Switch over to np.random where possible

* Start hashing seeds, and also seed doom engine

* Fixup seeding determinism in many cases

* Seed before loading the ROM

* Make seeding more Python3 friendly

* Make the MuJoCo skipping a bit more forgiving

* Remove debugging PDB calls

* Make setInt argument into raw bytes

* Validate and upload seeds

* Skip box2d

* Make seeds smaller, and change representation of seeds in upload

* Handle long seeds

* Fix RandomAgent example to be deterministic

* Handle integer types correctly in Python2 and Python3

* Try caching pip

* Try adding swap

* Add df and free calls

* Bump swap

* Bump swap size

* Try setting overcommit

* Try other sysctls

* Try fixing overcommit

* Try just setting overcommit_memory=1

* Add explanatory comment

* Add what's new section to readme

* BUG: Mark ElevatorAction-ram-v0 as non-deterministic for now

* Document seed

* Move nondetermistic check into spec
2016-05-29 09:07:09 -07:00
Greg Brockman
8376580c85 Improve closer implementation and docstrings (#126)
* Improve auto close implementation

- Register all envs at initialization time, not just ones created via make
- Simplify names and add more documentation on interface
- Move closer instances into the relevant modules

review-requested: @jietang

* Close environments in the tests

This isn't strictly needed, but means there are fewer Doom
subprocesses hanging around while the tests run.

* Use 4 space indent in comment

* Improve docstrings in core

* Don't pass through args to __new__

The __init__ method gets called once __new__ returns,
so these arguments are either ignored (Python 2) or
result in an error (Python 3). The __init__ method
automatically gets called with the correct arguments.

* Fixup comments
2016-05-27 12:16:35 -07:00
Jie Tang
90979cf11f Parse and save env_name in EnvSpec 2016-05-18 17:56:51 -07:00
Jie Tang
edaf643c57 Remove deprecated env file, report different error for deprecated envs 2016-05-18 17:56:51 -07:00
Jie Tang
b92796ae89 Renaming close_registry to closer 2016-05-18 01:27:58 -07:00
Jie Tang
72d29a52f6 Make close() idempotent, add tests, minor fixes 2016-05-16 23:11:50 -07:00
Jie Tang
751dcc15b1 Add close() to Env, add functionality to call close() on exit 2016-05-16 14:58:36 -07:00
Greg Brockman
b37495355e Handle deprecated envs better 2016-05-06 22:26:40 -07:00