Skip to content

Commit 2916273

Browse files
authored
Update loop conditions to be more idiomatic; fix missing imports (AtsushiSakai#768)
* missing import * use while true
1 parent 1d68343 commit 2916273

File tree

10 files changed

+10
-9
lines changed

10 files changed

+10
-9
lines changed

Mapping/rectangle_fitting/rectangle_fitting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def _adoptive_range_segmentation(self, ox, oy):
162162
S.append(C)
163163

164164
# Merge cluster
165-
while 1:
165+
while True:
166166
no_change = True
167167
for (c1, c2) in list(itertools.permutations(range(len(S)), 2)):
168168
if S[c1] & S[c2]:

PathPlanning/AStar/a_star.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def planning(self, sx, sy, gx, gy):
7171
open_set, closed_set = dict(), dict()
7272
open_set[self.calc_grid_index(start_node)] = start_node
7373

74-
while 1:
74+
while True:
7575
if len(open_set) == 0:
7676
print("Open set is empty..")
7777
break

PathPlanning/BidirectionalAStar/bidirectional_a_star.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def planning(self, sx, sy, gx, gy):
7575
current_B = goal_node
7676
meet_point_A, meet_point_B = None, None
7777

78-
while 1:
78+
while True:
7979
if len(open_set_A) == 0:
8080
print("Open set A is empty..")
8181
break

PathPlanning/BidirectionalBreadthFirstSearch/bidirectional_breadth_first_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def planning(self, sx, sy, gx, gy):
7676

7777
meet_point_A, meet_point_B = None, None
7878

79-
while 1:
79+
while True:
8080
if len(open_set_A) == 0:
8181
print("Open set A is empty..")
8282
break

PathPlanning/BreadthFirstSearch/breadth_first_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def planning(self, sx, sy, gx, gy):
6767
open_set, closed_set = dict(), dict()
6868
open_set[self.calc_grid_index(nstart)] = nstart
6969

70-
while 1:
70+
while True:
7171
if len(open_set) == 0:
7272
print("Open set is empty..")
7373
break

PathPlanning/DepthFirstSearch/depth_first_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def planning(self, sx, sy, gx, gy):
6767
open_set, closed_set = dict(), dict()
6868
open_set[self.calc_grid_index(nstart)] = nstart
6969

70-
while 1:
70+
while True:
7171
if len(open_set) == 0:
7272
print("Open set is empty..")
7373
break

PathPlanning/Dijkstra/dijkstra.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def planning(self, sx, sy, gx, gy):
7171
open_set, closed_set = dict(), dict()
7272
open_set[self.calc_index(start_node)] = start_node
7373

74-
while 1:
74+
while True:
7575
c_id = min(open_set, key=lambda o: open_set[o].cost)
7676
current = open_set[c_id]
7777

PathPlanning/GreedyBestFirstSearch/greedy_best_first_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def planning(self, sx, sy, gx, gy):
6767
open_set, closed_set = dict(), dict()
6868
open_set[self.calc_grid_index(nstart)] = nstart
6969

70-
while 1:
70+
while True:
7171
if len(open_set) == 0:
7272
print("Open set is empty..")
7373
break

PathPlanning/HybridAStar/dynamic_programming_heuristic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def calc_distance_heuristic(gx, gy, ox, oy, resolution, rr):
6565
open_set[calc_index(goal_node, x_w, min_x, min_y)] = goal_node
6666
priority_queue = [(0, calc_index(goal_node, x_w, min_x, min_y))]
6767

68-
while 1:
68+
while True:
6969
if not priority_queue:
7070
break
7171
cost, c_id = heapq.heappop(priority_queue)

tests/test_grid_map_lib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from Mapping.grid_map_lib.grid_map_lib import GridMap
2+
import conftest
23
import numpy as np
34

45

0 commit comments

Comments
 (0)