Skip to content

Commit 724da69

Browse files
committed
Remove all pyre-ignore comments
1 parent e2327bc commit 724da69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+32
-81
lines changed

examples/arcade_bot.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ def position_around_unit(
101101
step_size: int = 1,
102102
exclude_out_of_bounds: bool = True,
103103
):
104-
# pyre-ignore[16]
105104
pos = pos.position.rounded
106105
positions = {
107106
pos.offset(Point2((x, y)))
@@ -114,7 +113,6 @@ def position_around_unit(
114113
positions = {
115114
p
116115
for p in positions
117-
# pyre-ignore[16]
118116
if 0 <= p[0] < self.game_info.pathing_grid.width and 0 <= p[1] < self.game_info.pathing_grid.height
119117
}
120118
return positions

examples/competitive/bot.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ async def on_step(self, iteration: int):
1111
# Populate this function with whatever your bot should do!
1212
pass
1313

14-
# pyre-ignore[11]
1514
async def on_end(self, game_result: Result):
1615
print("Game ended.")
1716
# Do things here after the game ends

examples/competitive/run.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pyre-ignore-all-errors[16, 21]
21
import sys
32

43
from __init__ import run_ladder_game

examples/distributed_workers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pyre-ignore-all-errors[16]
21
from sc2 import maps
32
from sc2.bot_ai import BotAI
43
from sc2.data import Difficulty, Race

examples/protoss/find_adept_shades.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ async def on_step(self, iteration: int):
2626
if adepts and not self.shaded:
2727
# Wait for adepts to spawn and then cast ability
2828
for adept in adepts:
29-
# pyre-ignore[16]
3029
adept(AbilityId.ADEPTPHASESHIFT_ADEPTPHASESHIFT, self.game_info.map_center)
3130
self.shaded = True
3231
elif self.shades_mapping:
@@ -38,7 +37,6 @@ async def on_step(self, iteration: int):
3837
# logger.info(f"Remaining shade time: {shade.buff_duration_remain} / {shade.buff_duration_max}")
3938
pass
4039
if adept and shade:
41-
# pyre-ignore[16]
4240
self.client.debug_line_out(adept, shade, (0, 255, 0))
4341
# logger.info(self.shades_mapping)
4442
elif self.shaded:
@@ -53,7 +51,7 @@ async def on_step(self, iteration: int):
5351
previous_shade_location = shade.position.towards(
5452
forward_position, -(self.client.game_step / 16) * shade.movement_speed
5553
) # See docstring of movement_speed attribute
56-
# pyre-ignore[6]
54+
5755
closest_adept = remaining_adepts.closest_to(previous_shade_location)
5856
self.shades_mapping[closest_adept.tag] = shade.tag
5957

examples/terran/onebase_battlecruiser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def select_target(self) -> tuple[Point2, bool]:
2424
return targets.random.position, True
2525

2626
if self.units and min(u.position.distance_to(self.enemy_start_locations[0]) for u in self.units) < 5:
27-
# pyre-ignore[7]
2827
return self.enemy_start_locations[0].position, False
2928

3029
return self.mineral_field.random.position, False

examples/worker_stack_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ async def on_step(self, iteration: int):
8989
# Move worker in front of the nexus to avoid deceleration until the last moment
9090
if worker.distance_to(th) > th.radius + worker.radius + self.townhall_distance_threshold:
9191
pos: Point2 = th.position
92-
# pyre-ignore[6]
92+
9393
worker.move(pos.towards(worker, th.radius * self.townhall_distance_factor))
9494
worker.return_resource(queue=True)
9595
else:
9696
worker.return_resource()
9797
worker.gather(mineral, queue=True)
9898

9999
# Print info every 30 game-seconds
100-
# pyre-ignore[16]
100+
101101
if self.state.game_loop % (22.4 * 30) == 0:
102102
logger.info(f"{self.time_formatted} Mined a total of {int(self.state.score.collected_minerals)} minerals")
103103

examples/zerg/zerg_rush.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def draw_creep_pixelmap(self):
136136
color = Point3((0, 255, 0))
137137
self.client.debug_box2_out(pos, half_vertex_length=0.25, color=color)
138138

139-
# pyre-ignore[11]
140139
async def on_end(self, game_result: Result):
141140
self.on_end_called = True
142141
logger.info(f"{self.time_formatted} On end was called")

sc2/bot_ai.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pyre-ignore-all-errors[6, 16]
21
from __future__ import annotations
32

43
import math
@@ -71,7 +70,6 @@ def step_time(self) -> tuple[float, float, float, float]:
7170
self._last_step_step_time * 1000,
7271
)
7372

74-
# pyre-ignore[11]
7573
def alert(self, alert_code: Alert) -> bool:
7674
"""
7775
Check if alert is triggered in the current step.
@@ -1125,7 +1123,7 @@ def research(self, upgrade_type: UpgradeId) -> bool:
11251123
return False
11261124

11271125
research_structure_type: UnitTypeId = UPGRADE_RESEARCHED_FROM[upgrade_type]
1128-
# pyre-ignore[9]
1126+
11291127
required_tech_building: UnitTypeId | None = RESEARCH_INFO[research_structure_type][upgrade_type].get(
11301128
"required_building", None
11311129
)
@@ -1368,7 +1366,6 @@ async def on_step(self, iteration: int):
13681366
"""
13691367
raise NotImplementedError
13701368

1371-
# pyre-ignore[11]
13721369
async def on_end(self, game_result: Result) -> None:
13731370
"""Override this in your bot class. This function is called at the end of a game.
13741371
Unsure if this function will be called on the laddermanager client as the bot process may forcefully be terminated.

sc2/bot_ai_internal.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# pyre-ignore-all-errors[6, 16, 29]
21
from __future__ import annotations
32

43
import itertools
@@ -103,7 +102,7 @@ def _initialize_variables(self) -> None:
103102
self.warp_gate_count: int = 0
104103
self.actions: list[UnitCommand] = []
105104
self.blips: set[Blip] = set()
106-
# pyre-ignore[11]
105+
107106
self.race: Race | None = None
108107
self.enemy_race: Race | None = None
109108
self._generated_frame = -100

0 commit comments

Comments
 (0)