Commit Graph

66 Commits

Author SHA1 Message Date
Jesse Farebrother
2af816241e Fix namespace relocation error messages + update Robotic env relocation namespace (#2539)
* Update namespace relocation error message

* Add missing relocated envs + move to new file
2021-12-22 18:51:33 -05:00
Jesse Farebrother
eb6d826aac Update importlib_metadata entry_point calls (#2538) 2021-12-22 13:54:20 -05:00
Ilya Kamen
65eeb73366 Typing/basics (#2529)
* Typing in gym/envs/registration.py

* Add registration to type checked list

* Adds type hints to space.py

* Typing in gym.core.Env

* Typing in seeding.py

* fixup Typing after rebase

* revert accidental change

* Install dependencies in pyright runner

* fix: can only install dependencies after checkout

* fix: install types in a venv

* fix path

* skip env activation, install directly from venv interpreter

* absolute path to venv

* use central python installation

* skip one more typecheck

* cleanup gh actions .yml

* Add py.typed to signal using sources for typechecking

* black!

Co-authored-by: sj_petterson <sj_petterson@gmail.com>
Co-authored-by: J K Terry <justinkterry@gmail.com>
2021-12-22 13:12:57 -05:00
Rohan138
4966c5fccf Added robotics envs to relocation map (#2537) 2021-12-21 14:07:36 -05:00
Jesse Farebrother
a30568a06e plugins: Remove allow-list for registering environments in the root namespace (#2530) 2021-12-20 01:55:55 -05:00
Jesse Farebrother
3f5b46dfc1 Add warnings when using outdated versions of environments (#2481)
This introduces a new tree-like storage structures for environments
which allows for efficient lookups of what versions of an environment
are registered. Using this new data-structure we can give warnings
to users about outdated environments when `make` is called.
2021-11-20 10:43:36 -05:00
Elijah K
eec6167440 Py36+ syntax in gym/envs: derived by running pyupgrade --py36-plus gym/envs/**.py and flynt gym --ll 120 (#2465)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-13 19:53:32 -05:00
Jesse Farebrother
ca42b05243 Fix importlib-metadata on Python 3.8 + bump ale-py (#2428)
* Bump ale-py -> 0.7.1

* env-plugins: parse module,attr for Python 3.8
2021-09-28 19:45:01 -04:00
Jesse Farebrother
5a4709b158 Env plugins, remove gym.envs.internal and replace with __internal__ key (#2409) 2021-09-16 10:23:32 -04:00
Ahmed Omar
2754d9737e removed calls to reset from init (#2394)
* removed all calls to reset

* passing tests

* fix off-by-one error

* revert

* merge master into branch

* add OrderEnforcing Wrapper

* add orderenforcing to the docs

* add option for disabling

* add argument to EnvSpec
2021-09-16 10:16:49 -04:00
Jesse Farebrother
e212043a93 Add plugin system for third-party environments (#2383) 2021-09-14 22:14:05 -04:00
Rohan138
c00c1babb9 Remove unused toytext environments (#2384)
* Moved Unused ToyText Environments

* Fixed error message

* removed KellyCoinFlip test

removed KellyCoinFlip tests

removed KellyCoinFlip tests

* black

* Modified docs
2021-09-01 23:22:01 -04:00
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