Skip to content

Commit 429836c

Browse files
committed
Improve type hints.
1 parent 2d9eced commit 429836c

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

flatland/envs/rail_env.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class RailEnv(Environment):
9999
def __init__(self,
100100
width,
101101
height,
102-
rail_generator=None,
102+
rail_generator: "RailGenerator" = None,
103103
line_generator: "LineGenerator" = None, # : line_gen.LineGenerator = line_gen.random_line_generator(),
104104
number_of_agents=2,
105105
obs_builder_object: ObservationBuilder = GlobalObsForRailEnv(),

tests/test_over_under_passes.py

-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
def test_diamond_crossing_without_over_and_underpasses(rendering: bool = False):
1616
rail, rail_map, optionals = make_diamond_crossing_rail()
1717

18-
# TODO better way to init state?
1918
env = RailEnv(
2019
width=rail_map.shape[1],
2120
height=rail_map.shape[0],
22-
# TODO typing
2321
rail_generator=rail_from_grid_transition_map(rail, optionals),
2422
line_generator=sparse_line_generator(),
2523
number_of_agents=2,
@@ -96,7 +94,6 @@ def test_diamond_crossing_with_over_and_underpasses(rendering: bool = False):
9694
env = RailEnv(
9795
width=rail_map.shape[1],
9896
height=rail_map.shape[0],
99-
# TODO typing
10097
rail_generator=rail_from_grid_transition_map(rail, optionals),
10198
line_generator=sparse_line_generator(),
10299
number_of_agents=2,
@@ -172,18 +169,15 @@ def test_diamond_crossing_with_over_and_underpasses(rendering: bool = False):
172169
def test_diamond_crossing_with_over_and_underpasses_head_on(rendering: bool = False):
173170
rail, rail_map, optionals = make_diamond_crossing_rail()
174171

175-
# TODO better way to init state?
176172
env = RailEnv(
177173
width=rail_map.shape[1],
178174
height=rail_map.shape[0],
179-
# TODO typing
180175
rail_generator=rail_from_grid_transition_map(rail, optionals),
181176
line_generator=sparse_line_generator(),
182177
number_of_agents=2,
183178
obs_builder_object=TreeObsForRailEnv(max_depth=2, predictor=ShortestPathPredictorForRailEnv()),
184179
record_steps=True
185180
)
186-
187181
env.reset()
188182
env._max_episode_steps = 5
189183

0 commit comments

Comments
 (0)