Skip to content

Commit

Permalink
Expand env-id format
Browse files Browse the repository at this point in the history
  • Loading branch information
gdb committed Oct 31, 2016
1 parent 03af639 commit 6db689a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ You can also run tests in a specific directory by using the ``-s`` option, or by
What's new
----------

- 2016-10-31: We're experimentally expanding the environment ID format
to include an optional username.
- 2016-09-21: Switch the Gym automated logger setup to configure the
root logger rather than just the 'gym' logger.
- 2016-08-17: Calling `close` on an env will also close the monitor
Expand Down
8 changes: 6 additions & 2 deletions gym/envs/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

logger = logging.getLogger(__name__)
# This format is true today, but it's *not* an official spec.
env_id_re = re.compile(r'^([\w:-]+)-v(\d+)$')
# [username/](env-name)-v(version) env-name is group 1, version is group 2
#
# 2016-10-31: We're experimentally expanding the environment ID format
# to include an optional username.
env_id_re = re.compile(r'^(?:[\w:-]+\/)?([\w:-]+)-v(\d+)$')

def load(name):
entry_point = pkg_resources.EntryPoint.parse('x={}'.format(name))
Expand Down Expand Up @@ -43,7 +47,7 @@ def __init__(self, id, entry_point=None, timestep_limit=1000, trials=100, reward
self.reward_threshold = reward_threshold
# Environment properties
self.nondeterministic = nondeterministic

if tags is None:
tags = {}
self.tags = tags
Expand Down

0 comments on commit 6db689a

Please sign in to comment.