-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docopt #38
Conversation
still need to do:
|
adept/environments/env_registry.py
Outdated
|
||
def lookup_env_class(self, env_id): | ||
engine = self.lookup_engine(env_id) | ||
return self.plugin_class_by_engine_id[engine] | ||
return self._plugin_class_by_engine_id[engine] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_module_class_by_engine_id
adept/environments/_metadata.py
Outdated
@@ -34,15 +34,15 @@ def __init__(self, env_plugin_class, args): | |||
self._gpu_preprocessor = dummy_env.gpu_preprocessor | |||
|
|||
@classmethod | |||
def from_args(cls, args, registry=EnvPluginRegistry()): | |||
def from_args(cls, args, registry=EnvModuleRegistry()): | |||
""" | |||
Mimic the AdeptEnvPlugin.from_args API to simplify interface. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnvModule
adept/environments/_metadata.py
Outdated
""" | ||
Mimic the AdeptEnvPlugin.from_args API to simplify interface. | ||
|
||
:param args: Arguments object | ||
:param registry: Optionally provide to avoid recreating. | ||
:return: EnvMetaData | ||
""" | ||
plugin_class = registry.lookup_env_class(args.env_id) | ||
plugin_class = registry.lookup_env_class(args.env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module_class
@@ -63,38 +66,62 @@ class Engines(IntEnum): | |||
] | |||
|
|||
|
|||
class EnvPluginRegistry: | |||
class EnvModuleRegistry: | |||
""" | |||
Keeps track of supported environment plugins. | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modules
adept/environments/env_registry.py
Outdated
self.engine_ids_by_env_id_set = {} | ||
self.plugin_class_by_engine_id = {} | ||
self._engine_ids_by_env_id_set = {} | ||
self._plugin_class_by_engine_id = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
module_class
No description provided.