diff --git a/dev_tools/research_optimizer.py b/dev_tools/research_optimizer.py index 02bb48929..c9c937fe0 100644 --- a/dev_tools/research_optimizer.py +++ b/dev_tools/research_optimizer.py @@ -769,7 +769,7 @@ class ResearchPool: Returns: np.ndarray: Shape (188,), lower index means to be selected first. 1000 for not selected projects. """ - out = np.ones((PROJECTS.count,), dtype=np.int64) * 1000 + out = np.ones((PROJECTS.count,), dtype=int) * 1000 for index, project in enumerate(self.filter): if index != self.reset_index: out[project.index] = index diff --git a/module/base/utils.py b/module/base/utils.py index 6a3266884..92b5ad928 100644 --- a/module/base/utils.py +++ b/module/base/utils.py @@ -54,8 +54,8 @@ def random_rectangle_vector(vector, box, random_range=(0, 0, 0, 0), padding=15): tuple(int), tuple(int): start_point, end_point. """ vector = np.array(vector) + random_rectangle_point(random_range) - vector = np.round(vector).astype(np.int) - half_vector = np.round(vector / 2).astype(np.int) + vector = np.round(vector).astype(int) + half_vector = np.round(vector / 2).astype(int) box = np.array(box) + np.append(np.abs(half_vector) + padding, -np.abs(half_vector) - padding) center = random_rectangle_point(box) start_point = center - half_vector @@ -86,8 +86,8 @@ def random_rectangle_vector_opted( tuple(int), tuple(int): start_point, end_point. """ vector = np.array(vector) + random_rectangle_point(random_range) - vector = np.round(vector).astype(np.int) - half_vector = np.round(vector / 2).astype(np.int) + vector = np.round(vector).astype(int) + half_vector = np.round(vector / 2).astype(int) box_pad = np.array(box) + np.append(np.abs(half_vector) + padding, -np.abs(half_vector) - padding) box_pad = area_offset(box_pad, half_vector) segment = int(np.linalg.norm(vector) // 70) + 1 diff --git a/module/device/method/minitouch.py b/module/device/method/minitouch.py index deef6c0f5..90dde85ab 100644 --- a/module/device/method/minitouch.py +++ b/module/device/method/minitouch.py @@ -74,7 +74,7 @@ def insert_swipe(p0, p3, speed=15, min_distance=10): prev = (-100, -100) for t in ts: point = p0 * (1 - t) ** 3 + 3 * p1 * t * (1 - t) ** 2 + 3 * p2 * t ** 2 * (1 - t) + p3 * t ** 3 - point = point.astype(np.int).tolist() + point = point.astype(int).tolist() if np.linalg.norm(np.subtract(point, prev)) < min_distance: continue diff --git a/module/map/utils.py b/module/map/utils.py index 4e61da978..9556fb2ab 100644 --- a/module/map/utils.py +++ b/module/map/utils.py @@ -147,7 +147,7 @@ def match_movable(before, spawn, after, fleets, fleet_step=2): after = after + fleets x = len(after) y = len(before) - distance = np.ones((y, x), dtype=np.int) * base_weight + distance = np.ones((y, x), dtype=int) * base_weight for i1, g1 in enumerate(before): for i2, g2 in enumerate(after): distance[i1, i2] = fleet_step - sum(abs(np.subtract(g1, g2))) diff --git a/module/os/radar.py b/module/os/radar.py index 5f6eb9b7e..8d5e45c12 100644 --- a/module/os/radar.py +++ b/module/os/radar.py @@ -171,7 +171,7 @@ class Radar: for y in range(*self.shape[1]): if np.linalg.norm([x, y]) > radius: continue - grid_center = np.round(delta * (x, y) + center).astype(np.int) + grid_center = np.round(delta * (x, y) + center).astype(int) self.grids[(x, y)] = RadarGrid(location=(x, y), image=None, center=grid_center, config=self.config) def __iter__(self):