Skip to content
Snippets Groups Projects
Commit e56afb89 authored by u214892's avatar u214892
Browse files

#178 added type hints

parent 0a7ebfd0
No related branches found
No related tags found
No related merge requests found
"""Test Utils.""" """Test Utils."""
from typing import List from typing import List, Tuple
from attr import attrs, attrib from attr import attrs, attrib
from flatland.core.grid.grid4 import Grid4TransitionsEnum
from flatland.envs.rail_env import RailEnvActions from flatland.envs.rail_env import RailEnvActions
@attrs @attrs
class Replay(object): class Replay(object):
position = attrib() position = attrib(type=Tuple[int, int])
direction = attrib() direction = attrib(type=Grid4TransitionsEnum)
action = attrib(type=RailEnvActions) action = attrib(type=RailEnvActions)
malfunction = attrib(default=0, type=int) malfunction = attrib(default=0, type=int)
...@@ -17,5 +18,5 @@ class Replay(object): ...@@ -17,5 +18,5 @@ class Replay(object):
@attrs @attrs
class ReplayConfig(object): class ReplayConfig(object):
replay = attrib(type=List[Replay]) replay = attrib(type=List[Replay])
target = attrib() target = attrib(type=Tuple[int, int])
speed = attrib(type=float) speed = attrib(type=float)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment