浏览代码
Enable mypy in precommit checks (#2177)
Enable mypy in precommit checks (#2177)
* WIP precommit on top level * update CI * circleci fixes * intentionally fail black * use --show-diff-on-failure in CI * fix command order * rebreak a file * apply black * WIP enable mypy * run mypy on each package * fix trainer_metrics mypy errors * more mypy errors * more mypy * Fix some partially typed functions * types for take_action_outputs * fix formatting * cleanup * generate stubs for proto objects * fix ml-agents-env mypy errors * disallow-incomplete-defs for gym-unity * Add CI notes to CONTRIBUTING.md/develop-generalizationTraining-TrainerController
GitHub
6 年前
当前提交
2671e1a0
共有 46 个文件被更改,包括 1071 次插入 和 99 次删除
-
1.gitignore
-
20.pre-commit-config.yaml
-
16CONTRIBUTING.md
-
14gym-unity/gym_unity/envs/unity_env.py
-
22ml-agents-envs/mlagents/envs/brain.py
-
3ml-agents-envs/mlagents/envs/communicator.py
-
1ml-agents-envs/mlagents/envs/communicator_objects/unity_to_external_pb2.py
-
42ml-agents-envs/mlagents/envs/environment.py
-
3ml-agents-envs/mlagents/envs/rpc_communicator.py
-
3ml-agents-envs/mlagents/envs/socket_communicator.py
-
4ml-agents-envs/mlagents/envs/subprocess_environment.py
-
1ml-agents-envs/mlagents/envs/tests/test_subprocess_unity_environment.py
-
4ml-agents/mlagents/trainers/action_info.py
-
12ml-agents/mlagents/trainers/bc/online_trainer.py
-
12ml-agents/mlagents/trainers/bc/trainer.py
-
3ml-agents/mlagents/trainers/demo_loader.py
-
8ml-agents/mlagents/trainers/learn.py
-
5ml-agents/mlagents/trainers/policy.py
-
15ml-agents/mlagents/trainers/ppo/trainer.py
-
8ml-agents/mlagents/trainers/tests/test_trainer_controller.py
-
13ml-agents/mlagents/trainers/trainer.py
-
19ml-agents/mlagents/trainers/trainer_controller.py
-
33ml-agents/mlagents/trainers/trainer_metrics.py
-
2protobuf-definitions/README.md
-
2protobuf-definitions/make.bat
-
51ml-agents-envs/mlagents/envs/communicator_objects/agent_action_proto_pb2.pyi
-
65ml-agents-envs/mlagents/envs/communicator_objects/agent_info_proto_pb2.pyi
-
60ml-agents-envs/mlagents/envs/communicator_objects/brain_parameters_proto_pb2.pyi
-
32ml-agents-envs/mlagents/envs/communicator_objects/command_proto_pb2.pyi
-
15ml-agents-envs/mlagents/envs/communicator_objects/custom_action_pb2.pyi
-
15ml-agents-envs/mlagents/envs/communicator_objects/custom_observation_pb2.pyi
-
15ml-agents-envs/mlagents/envs/communicator_objects/custom_reset_parameters_pb2.pyi
-
38ml-agents-envs/mlagents/envs/communicator_objects/demonstration_meta_proto_pb2.pyi
-
39ml-agents-envs/mlagents/envs/communicator_objects/engine_configuration_proto_pb2.pyi
-
61ml-agents-envs/mlagents/envs/communicator_objects/environment_parameters_proto_pb2.pyi
-
32ml-agents-envs/mlagents/envs/communicator_objects/header_pb2.pyi
-
33ml-agents-envs/mlagents/envs/communicator_objects/resolution_proto_pb2.pyi
-
31ml-agents-envs/mlagents/envs/communicator_objects/space_type_proto_pb2.pyi
-
45ml-agents-envs/mlagents/envs/communicator_objects/unity_input_pb2.pyi
-
53ml-agents-envs/mlagents/envs/communicator_objects/unity_message_pb2.pyi
-
45ml-agents-envs/mlagents/envs/communicator_objects/unity_output_pb2.pyi
-
29ml-agents-envs/mlagents/envs/communicator_objects/unity_rl_initialization_input_pb2.pyi
-
57ml-agents-envs/mlagents/envs/communicator_objects/unity_rl_initialization_output_pb2.pyi
-
99ml-agents-envs/mlagents/envs/communicator_objects/unity_rl_input_pb2.pyi
-
83ml-agents-envs/mlagents/envs/communicator_objects/unity_rl_output_pb2.pyi
-
6ml-agents-envs/mlagents/envs/communicator_objects/unity_to_external_pb2.pyi
|
|||
exclude: '^$' |
|||
fail_fast: false |
|||
- repo: https://github.com/pre-commit/mirrors-mypy |
|||
rev: 'v0.701' |
|||
hooks: |
|||
- id: mypy |
|||
name: mypy-ml-agents |
|||
files: "ml-agents/.*" |
|||
args: [--ignore-missing-imports, --disallow-incomplete-defs] |
|||
- id: mypy |
|||
name: mypy-ml-agents-envs |
|||
files: "ml-agents-envs/.*" |
|||
# Exclude protobuf files and don't follow them when imported |
|||
exclude: ".*_pb2.py" |
|||
# TODO get disallow-incomplete-defs working |
|||
args: [--ignore-missing-imports, --follow-imports=silent] |
|||
- id: mypy |
|||
name: mypy-gym-unity |
|||
files: "gym-unity/.*" |
|||
args: [--ignore-missing-imports, --disallow-incomplete-defs] |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.internal.containers import ( |
|||
RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, |
|||
) |
|||
|
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.custom_action_pb2 import ( |
|||
CustomAction as mlagents___envs___communicator_objects___custom_action_pb2___CustomAction, |
|||
) |
|||
|
|||
from typing import ( |
|||
Iterable as typing___Iterable, |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class AgentActionProto(google___protobuf___message___Message): |
|||
vector_actions = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[float] |
|||
text_actions = ... # type: typing___Text |
|||
memories = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[float] |
|||
value = ... # type: float |
|||
|
|||
@property |
|||
def custom_action(self) -> mlagents___envs___communicator_objects___custom_action_pb2___CustomAction: ... |
|||
|
|||
def __init__(self, |
|||
vector_actions : typing___Optional[typing___Iterable[float]] = None, |
|||
text_actions : typing___Optional[typing___Text] = None, |
|||
memories : typing___Optional[typing___Iterable[float]] = None, |
|||
value : typing___Optional[float] = None, |
|||
custom_action : typing___Optional[mlagents___envs___communicator_objects___custom_action_pb2___CustomAction] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> AgentActionProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def HasField(self, field_name: typing_extensions___Literal[u"custom_action"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"custom_action",u"memories",u"text_actions",u"value",u"vector_actions"]) -> None: ... |
|||
else: |
|||
def HasField(self, field_name: typing_extensions___Literal[u"custom_action",b"custom_action"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"custom_action",b"memories",b"text_actions",b"value",b"vector_actions"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.internal.containers import ( |
|||
RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, |
|||
) |
|||
|
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.custom_observation_pb2 import ( |
|||
CustomObservation as mlagents___envs___communicator_objects___custom_observation_pb2___CustomObservation, |
|||
) |
|||
|
|||
from typing import ( |
|||
Iterable as typing___Iterable, |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class AgentInfoProto(google___protobuf___message___Message): |
|||
stacked_vector_observation = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[float] |
|||
visual_observations = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[bytes] |
|||
text_observation = ... # type: typing___Text |
|||
stored_vector_actions = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[float] |
|||
stored_text_actions = ... # type: typing___Text |
|||
memories = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[float] |
|||
reward = ... # type: float |
|||
done = ... # type: bool |
|||
max_step_reached = ... # type: bool |
|||
id = ... # type: int |
|||
action_mask = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[bool] |
|||
|
|||
@property |
|||
def custom_observation(self) -> mlagents___envs___communicator_objects___custom_observation_pb2___CustomObservation: ... |
|||
|
|||
def __init__(self, |
|||
stacked_vector_observation : typing___Optional[typing___Iterable[float]] = None, |
|||
visual_observations : typing___Optional[typing___Iterable[bytes]] = None, |
|||
text_observation : typing___Optional[typing___Text] = None, |
|||
stored_vector_actions : typing___Optional[typing___Iterable[float]] = None, |
|||
stored_text_actions : typing___Optional[typing___Text] = None, |
|||
memories : typing___Optional[typing___Iterable[float]] = None, |
|||
reward : typing___Optional[float] = None, |
|||
done : typing___Optional[bool] = None, |
|||
max_step_reached : typing___Optional[bool] = None, |
|||
id : typing___Optional[int] = None, |
|||
action_mask : typing___Optional[typing___Iterable[bool]] = None, |
|||
custom_observation : typing___Optional[mlagents___envs___communicator_objects___custom_observation_pb2___CustomObservation] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> AgentInfoProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def HasField(self, field_name: typing_extensions___Literal[u"custom_observation"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"action_mask",u"custom_observation",u"done",u"id",u"max_step_reached",u"memories",u"reward",u"stacked_vector_observation",u"stored_text_actions",u"stored_vector_actions",u"text_observation",u"visual_observations"]) -> None: ... |
|||
else: |
|||
def HasField(self, field_name: typing_extensions___Literal[u"custom_observation",b"custom_observation"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"action_mask",b"custom_observation",b"done",b"id",b"max_step_reached",b"memories",b"reward",b"stacked_vector_observation",b"stored_text_actions",b"stored_vector_actions",b"text_observation",b"visual_observations"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.internal.containers import ( |
|||
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, |
|||
RepeatedScalarFieldContainer as google___protobuf___internal___containers___RepeatedScalarFieldContainer, |
|||
) |
|||
|
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.resolution_proto_pb2 import ( |
|||
ResolutionProto as mlagents___envs___communicator_objects___resolution_proto_pb2___ResolutionProto, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.space_type_proto_pb2 import ( |
|||
SpaceTypeProto as mlagents___envs___communicator_objects___space_type_proto_pb2___SpaceTypeProto, |
|||
) |
|||
|
|||
from typing import ( |
|||
Iterable as typing___Iterable, |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class BrainParametersProto(google___protobuf___message___Message): |
|||
vector_observation_size = ... # type: int |
|||
num_stacked_vector_observations = ... # type: int |
|||
vector_action_size = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[int] |
|||
vector_action_descriptions = ... # type: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] |
|||
vector_action_space_type = ... # type: mlagents___envs___communicator_objects___space_type_proto_pb2___SpaceTypeProto |
|||
brain_name = ... # type: typing___Text |
|||
is_training = ... # type: bool |
|||
|
|||
@property |
|||
def camera_resolutions(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents___envs___communicator_objects___resolution_proto_pb2___ResolutionProto]: ... |
|||
|
|||
def __init__(self, |
|||
vector_observation_size : typing___Optional[int] = None, |
|||
num_stacked_vector_observations : typing___Optional[int] = None, |
|||
vector_action_size : typing___Optional[typing___Iterable[int]] = None, |
|||
camera_resolutions : typing___Optional[typing___Iterable[mlagents___envs___communicator_objects___resolution_proto_pb2___ResolutionProto]] = None, |
|||
vector_action_descriptions : typing___Optional[typing___Iterable[typing___Text]] = None, |
|||
vector_action_space_type : typing___Optional[mlagents___envs___communicator_objects___space_type_proto_pb2___SpaceTypeProto] = None, |
|||
brain_name : typing___Optional[typing___Text] = None, |
|||
is_training : typing___Optional[bool] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> BrainParametersProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"brain_name",u"camera_resolutions",u"is_training",u"num_stacked_vector_observations",u"vector_action_descriptions",u"vector_action_size",u"vector_action_space_type",u"vector_observation_size"]) -> None: ... |
|||
else: |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"brain_name",b"camera_resolutions",b"is_training",b"num_stacked_vector_observations",b"vector_action_descriptions",b"vector_action_size",b"vector_action_space_type",b"vector_observation_size"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.descriptor import ( |
|||
EnumDescriptor as google___protobuf___descriptor___EnumDescriptor, |
|||
) |
|||
|
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from typing import ( |
|||
List as typing___List, |
|||
Tuple as typing___Tuple, |
|||
cast as typing___cast, |
|||
) |
|||
|
|||
|
|||
class CommandProto(int): |
|||
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... |
|||
@classmethod |
|||
def Name(cls, number: int) -> str: ... |
|||
@classmethod |
|||
def Value(cls, name: str) -> CommandProto: ... |
|||
@classmethod |
|||
def keys(cls) -> typing___List[str]: ... |
|||
@classmethod |
|||
def values(cls) -> typing___List[CommandProto]: ... |
|||
@classmethod |
|||
def items(cls) -> typing___List[typing___Tuple[str, CommandProto]]: ... |
|||
STEP = typing___cast(CommandProto, 0) |
|||
RESET = typing___cast(CommandProto, 1) |
|||
QUIT = typing___cast(CommandProto, 2) |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
|
|||
class CustomAction(google___protobuf___message___Message): |
|||
|
|||
def __init__(self, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> CustomAction: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
|
|||
class CustomObservation(google___protobuf___message___Message): |
|||
|
|||
def __init__(self, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> CustomObservation: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
|
|||
class CustomResetParameters(google___protobuf___message___Message): |
|||
|
|||
def __init__(self, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> CustomResetParameters: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class DemonstrationMetaProto(google___protobuf___message___Message): |
|||
api_version = ... # type: int |
|||
demonstration_name = ... # type: typing___Text |
|||
number_steps = ... # type: int |
|||
number_episodes = ... # type: int |
|||
mean_reward = ... # type: float |
|||
|
|||
def __init__(self, |
|||
api_version : typing___Optional[int] = None, |
|||
demonstration_name : typing___Optional[typing___Text] = None, |
|||
number_steps : typing___Optional[int] = None, |
|||
number_episodes : typing___Optional[int] = None, |
|||
mean_reward : typing___Optional[float] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> DemonstrationMetaProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"api_version",u"demonstration_name",u"mean_reward",u"number_episodes",u"number_steps"]) -> None: ... |
|||
else: |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"api_version",b"demonstration_name",b"mean_reward",b"number_episodes",b"number_steps"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class EngineConfigurationProto(google___protobuf___message___Message): |
|||
width = ... # type: int |
|||
height = ... # type: int |
|||
quality_level = ... # type: int |
|||
time_scale = ... # type: float |
|||
target_frame_rate = ... # type: int |
|||
show_monitor = ... # type: bool |
|||
|
|||
def __init__(self, |
|||
width : typing___Optional[int] = None, |
|||
height : typing___Optional[int] = None, |
|||
quality_level : typing___Optional[int] = None, |
|||
time_scale : typing___Optional[float] = None, |
|||
target_frame_rate : typing___Optional[int] = None, |
|||
show_monitor : typing___Optional[bool] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> EngineConfigurationProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"height",u"quality_level",u"show_monitor",u"target_frame_rate",u"time_scale",u"width"]) -> None: ... |
|||
else: |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"height",b"quality_level",b"show_monitor",b"target_frame_rate",b"time_scale",b"width"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.custom_reset_parameters_pb2 import ( |
|||
CustomResetParameters as mlagents___envs___communicator_objects___custom_reset_parameters_pb2___CustomResetParameters, |
|||
) |
|||
|
|||
from typing import ( |
|||
Mapping as typing___Mapping, |
|||
MutableMapping as typing___MutableMapping, |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class EnvironmentParametersProto(google___protobuf___message___Message): |
|||
class FloatParametersEntry(google___protobuf___message___Message): |
|||
key = ... # type: typing___Text |
|||
value = ... # type: float |
|||
|
|||
def __init__(self, |
|||
key : typing___Optional[typing___Text] = None, |
|||
value : typing___Optional[float] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> EnvironmentParametersProto.FloatParametersEntry: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"key",u"value"]) -> None: ... |
|||
else: |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"key",b"value"]) -> None: ... |
|||
|
|||
|
|||
@property |
|||
def float_parameters(self) -> typing___MutableMapping[typing___Text, float]: ... |
|||
|
|||
@property |
|||
def custom_reset_parameters(self) -> mlagents___envs___communicator_objects___custom_reset_parameters_pb2___CustomResetParameters: ... |
|||
|
|||
def __init__(self, |
|||
float_parameters : typing___Optional[typing___Mapping[typing___Text, float]] = None, |
|||
custom_reset_parameters : typing___Optional[mlagents___envs___communicator_objects___custom_reset_parameters_pb2___CustomResetParameters] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> EnvironmentParametersProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def HasField(self, field_name: typing_extensions___Literal[u"custom_reset_parameters"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"custom_reset_parameters",u"float_parameters"]) -> None: ... |
|||
else: |
|||
def HasField(self, field_name: typing_extensions___Literal[u"custom_reset_parameters",b"custom_reset_parameters"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"custom_reset_parameters",b"float_parameters"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class Header(google___protobuf___message___Message): |
|||
status = ... # type: int |
|||
message = ... # type: typing___Text |
|||
|
|||
def __init__(self, |
|||
status : typing___Optional[int] = None, |
|||
message : typing___Optional[typing___Text] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> Header: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"message",u"status"]) -> None: ... |
|||
else: |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"message",b"status"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class ResolutionProto(google___protobuf___message___Message): |
|||
width = ... # type: int |
|||
height = ... # type: int |
|||
gray_scale = ... # type: bool |
|||
|
|||
def __init__(self, |
|||
width : typing___Optional[int] = None, |
|||
height : typing___Optional[int] = None, |
|||
gray_scale : typing___Optional[bool] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> ResolutionProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"gray_scale",u"height",u"width"]) -> None: ... |
|||
else: |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"gray_scale",b"height",b"width"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.descriptor import ( |
|||
EnumDescriptor as google___protobuf___descriptor___EnumDescriptor, |
|||
) |
|||
|
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from typing import ( |
|||
List as typing___List, |
|||
Tuple as typing___Tuple, |
|||
cast as typing___cast, |
|||
) |
|||
|
|||
|
|||
class SpaceTypeProto(int): |
|||
DESCRIPTOR: google___protobuf___descriptor___EnumDescriptor = ... |
|||
@classmethod |
|||
def Name(cls, number: int) -> str: ... |
|||
@classmethod |
|||
def Value(cls, name: str) -> SpaceTypeProto: ... |
|||
@classmethod |
|||
def keys(cls) -> typing___List[str]: ... |
|||
@classmethod |
|||
def values(cls) -> typing___List[SpaceTypeProto]: ... |
|||
@classmethod |
|||
def items(cls) -> typing___List[typing___Tuple[str, SpaceTypeProto]]: ... |
|||
discrete = typing___cast(SpaceTypeProto, 0) |
|||
continuous = typing___cast(SpaceTypeProto, 1) |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.unity_rl_initialization_input_pb2 import ( |
|||
UnityRLInitializationInput as mlagents___envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInput, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.unity_rl_input_pb2 import ( |
|||
UnityRLInput as mlagents___envs___communicator_objects___unity_rl_input_pb2___UnityRLInput, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class UnityInput(google___protobuf___message___Message): |
|||
|
|||
@property |
|||
def rl_input(self) -> mlagents___envs___communicator_objects___unity_rl_input_pb2___UnityRLInput: ... |
|||
|
|||
@property |
|||
def rl_initialization_input(self) -> mlagents___envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInput: ... |
|||
|
|||
def __init__(self, |
|||
rl_input : typing___Optional[mlagents___envs___communicator_objects___unity_rl_input_pb2___UnityRLInput] = None, |
|||
rl_initialization_input : typing___Optional[mlagents___envs___communicator_objects___unity_rl_initialization_input_pb2___UnityRLInitializationInput] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> UnityInput: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def HasField(self, field_name: typing_extensions___Literal[u"rl_initialization_input",u"rl_input"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"rl_initialization_input",u"rl_input"]) -> None: ... |
|||
else: |
|||
def HasField(self, field_name: typing_extensions___Literal[u"rl_initialization_input",b"rl_initialization_input",u"rl_input",b"rl_input"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"rl_initialization_input",b"rl_input"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.header_pb2 import ( |
|||
Header as mlagents___envs___communicator_objects___header_pb2___Header, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.unity_input_pb2 import ( |
|||
UnityInput as mlagents___envs___communicator_objects___unity_input_pb2___UnityInput, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.unity_output_pb2 import ( |
|||
UnityOutput as mlagents___envs___communicator_objects___unity_output_pb2___UnityOutput, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class UnityMessage(google___protobuf___message___Message): |
|||
|
|||
@property |
|||
def header(self) -> mlagents___envs___communicator_objects___header_pb2___Header: ... |
|||
|
|||
@property |
|||
def unity_output(self) -> mlagents___envs___communicator_objects___unity_output_pb2___UnityOutput: ... |
|||
|
|||
@property |
|||
def unity_input(self) -> mlagents___envs___communicator_objects___unity_input_pb2___UnityInput: ... |
|||
|
|||
def __init__(self, |
|||
header : typing___Optional[mlagents___envs___communicator_objects___header_pb2___Header] = None, |
|||
unity_output : typing___Optional[mlagents___envs___communicator_objects___unity_output_pb2___UnityOutput] = None, |
|||
unity_input : typing___Optional[mlagents___envs___communicator_objects___unity_input_pb2___UnityInput] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> UnityMessage: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def HasField(self, field_name: typing_extensions___Literal[u"header",u"unity_input",u"unity_output"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"header",u"unity_input",u"unity_output"]) -> None: ... |
|||
else: |
|||
def HasField(self, field_name: typing_extensions___Literal[u"header",b"header",u"unity_input",b"unity_input",u"unity_output",b"unity_output"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"header",b"unity_input",b"unity_output"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.unity_rl_initialization_output_pb2 import ( |
|||
UnityRLInitializationOutput as mlagents___envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutput, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.unity_rl_output_pb2 import ( |
|||
UnityRLOutput as mlagents___envs___communicator_objects___unity_rl_output_pb2___UnityRLOutput, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class UnityOutput(google___protobuf___message___Message): |
|||
|
|||
@property |
|||
def rl_output(self) -> mlagents___envs___communicator_objects___unity_rl_output_pb2___UnityRLOutput: ... |
|||
|
|||
@property |
|||
def rl_initialization_output(self) -> mlagents___envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutput: ... |
|||
|
|||
def __init__(self, |
|||
rl_output : typing___Optional[mlagents___envs___communicator_objects___unity_rl_output_pb2___UnityRLOutput] = None, |
|||
rl_initialization_output : typing___Optional[mlagents___envs___communicator_objects___unity_rl_initialization_output_pb2___UnityRLInitializationOutput] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> UnityOutput: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def HasField(self, field_name: typing_extensions___Literal[u"rl_initialization_output",u"rl_output"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"rl_initialization_output",u"rl_output"]) -> None: ... |
|||
else: |
|||
def HasField(self, field_name: typing_extensions___Literal[u"rl_initialization_output",b"rl_initialization_output",u"rl_output",b"rl_output"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"rl_initialization_output",b"rl_output"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from typing import ( |
|||
Optional as typing___Optional, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class UnityRLInitializationInput(google___protobuf___message___Message): |
|||
seed = ... # type: int |
|||
|
|||
def __init__(self, |
|||
seed : typing___Optional[int] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> UnityRLInitializationInput: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"seed"]) -> None: ... |
|||
else: |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"seed"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.internal.containers import ( |
|||
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, |
|||
) |
|||
|
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.brain_parameters_proto_pb2 import ( |
|||
BrainParametersProto as mlagents___envs___communicator_objects___brain_parameters_proto_pb2___BrainParametersProto, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.environment_parameters_proto_pb2 import ( |
|||
EnvironmentParametersProto as mlagents___envs___communicator_objects___environment_parameters_proto_pb2___EnvironmentParametersProto, |
|||
) |
|||
|
|||
from typing import ( |
|||
Iterable as typing___Iterable, |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class UnityRLInitializationOutput(google___protobuf___message___Message): |
|||
name = ... # type: typing___Text |
|||
version = ... # type: typing___Text |
|||
log_path = ... # type: typing___Text |
|||
|
|||
@property |
|||
def brain_parameters(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents___envs___communicator_objects___brain_parameters_proto_pb2___BrainParametersProto]: ... |
|||
|
|||
@property |
|||
def environment_parameters(self) -> mlagents___envs___communicator_objects___environment_parameters_proto_pb2___EnvironmentParametersProto: ... |
|||
|
|||
def __init__(self, |
|||
name : typing___Optional[typing___Text] = None, |
|||
version : typing___Optional[typing___Text] = None, |
|||
log_path : typing___Optional[typing___Text] = None, |
|||
brain_parameters : typing___Optional[typing___Iterable[mlagents___envs___communicator_objects___brain_parameters_proto_pb2___BrainParametersProto]] = None, |
|||
environment_parameters : typing___Optional[mlagents___envs___communicator_objects___environment_parameters_proto_pb2___EnvironmentParametersProto] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> UnityRLInitializationOutput: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def HasField(self, field_name: typing_extensions___Literal[u"environment_parameters"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[u"brain_parameters",u"environment_parameters",u"log_path",u"name",u"version"]) -> None: ... |
|||
else: |
|||
def HasField(self, field_name: typing_extensions___Literal[u"environment_parameters",b"environment_parameters"]) -> bool: ... |
|||
def ClearField(self, field_name: typing_extensions___Literal[b"brain_parameters",b"environment_parameters",b"log_path",b"name",b"version"]) -> None: ... |
|
|||
# @generated by generate_proto_mypy_stubs.py. Do not edit! |
|||
import sys |
|||
from google.protobuf.internal.containers import ( |
|||
RepeatedCompositeFieldContainer as google___protobuf___internal___containers___RepeatedCompositeFieldContainer, |
|||
) |
|||
|
|||
from google.protobuf.message import ( |
|||
Message as google___protobuf___message___Message, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.agent_action_proto_pb2 import ( |
|||
AgentActionProto as mlagents___envs___communicator_objects___agent_action_proto_pb2___AgentActionProto, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.command_proto_pb2 import ( |
|||
CommandProto as mlagents___envs___communicator_objects___command_proto_pb2___CommandProto, |
|||
) |
|||
|
|||
from mlagents.envs.communicator_objects.environment_parameters_proto_pb2 import ( |
|||
EnvironmentParametersProto as mlagents___envs___communicator_objects___environment_parameters_proto_pb2___EnvironmentParametersProto, |
|||
) |
|||
|
|||
from typing import ( |
|||
Iterable as typing___Iterable, |
|||
Mapping as typing___Mapping, |
|||
MutableMapping as typing___MutableMapping, |
|||
Optional as typing___Optional, |
|||
Text as typing___Text, |
|||
) |
|||
|
|||
from typing_extensions import ( |
|||
Literal as typing_extensions___Literal, |
|||
) |
|||
|
|||
|
|||
class UnityRLInput(google___protobuf___message___Message): |
|||
class ListAgentActionProto(google___protobuf___message___Message): |
|||
|
|||
@property |
|||
def value(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[mlagents___envs___communicator_objects___agent_action_proto_pb2___AgentActionProto]: ... |
|||
|
|||
def __init__(self, |
|||
value : typing___Optional[typing___Iterable[mlagents___envs___communicator_objects___agent_action_proto_pb2___AgentActionProto]] = None, |
|||
) -> None: ... |
|||
@classmethod |
|||
def FromString(cls, s: bytes) -> UnityRLInput.ListAgentActionProto: ... |
|||
def MergeFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
def CopyFrom(self, other_msg: google___protobuf___message___Message) -> None: ... |
|||
if sys.version_info >= (3,): |
|||
def ClearField(self, field_name: typing_ext |