Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Flatland
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
yoogottamk
Flatland
Commits
e56afb89
Commit
e56afb89
authored
5 years ago
by
u214892
Browse files
Options
Downloads
Patches
Plain Diff
#178 added type hints
parent
0a7ebfd0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_utils.py
+5
-4
5 additions, 4 deletions
tests/test_utils.py
with
5 additions
and
4 deletions
tests/test_utils.py
+
5
−
4
View file @
e56afb89
"""
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment