-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add --namespace-packages to mypy for mlagents #3075
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
Conversation
@@ -57,6 +57,7 @@ def __init__(self, seed, brain, trainer_parameters): | |||
self.brain = brain | |||
self.use_recurrent = trainer_parameters["use_recurrent"] | |||
self.memory_dict: Dict[str, np.ndarray] = {} | |||
self.reward_signals: Dict[str, "RewardSignal"] = {} |
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.
Used the string form here, because importing RewardSignal was leading to circular imports.
@@ -1,6 +1,6 @@ | |||
from typing import NamedTuple, Any, Dict, Optional | |||
from typing import NamedTuple, Any, Dict |
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.
from mlagents.trainers.brain import AllBrainInfo, BrainParameters | ||
from mlagents.trainers.policy import Policy | ||
from mlagents.trainers.action_info import ActionInfo | ||
|
||
|
||
class EnvironmentStep(NamedTuple): | ||
previous_all_brain_info: Optional[AllBrainInfo] | ||
previous_all_brain_info: AllBrainInfo |
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.
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.
Looks good to me
@@ -67,13 +67,14 @@ def __init__( | |||
self.check_param_keys() | |||
|
|||
if multi_gpu and len(get_devices()) > 1: | |||
self.policy = MultiGpuPPOPolicy( | |||
self.ppo_policy = MultiGpuPPOPolicy( |
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.
@ervteng This is what we talked about offline
from mlagents.trainers.brain import AllBrainInfo, BrainParameters | ||
from mlagents.trainers.policy import Policy | ||
from mlagents.trainers.action_info import ActionInfo | ||
|
||
|
||
class EnvironmentStep(NamedTuple): | ||
previous_all_brain_info: Optional[AllBrainInfo] | ||
previous_all_brain_info: AllBrainInfo |
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.
Looks good to me
Follow up from #3049
--namespace-packages
to the mypy settings for ml-agents