Skip to content

Commit 7c1aa7e

Browse files
E501 for build_kdtree.py, hypercube_points.py, nearest_neighbour_search.py
1 parent 4608a9f commit 7c1aa7e

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

data_structures/kd_tree/build_kdtree.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ def build_kdtree(points: list[list[float]], depth: int = 0) -> KDNode | None:
77
88
Args:
99
points (list[list[float]]): The list of points to build the KD-Tree from.
10-
depth (int): The current depth in the tree (used to determine axis for splitting).
10+
depth (int): The current depth in the tree
11+
(used to determine axis for splitting).
1112
1213
Returns:
13-
KDNode | None: The root node of the KD-Tree, or None if no points are provided.
14+
KDNode | None: The root node of the KD-Tree,
15+
or None if no points are provided.
1416
"""
1517
if not points:
1618
return None

data_structures/kd_tree/example/hypercube_points.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ def hypercube_points(
1313
num_dimensions (int): Number of dimensions of the hypercube.
1414
1515
Returns:
16-
np.ndarray: An array of shape (num_points, num_dimensions) with generated points.
16+
np.ndarray: An array of shape (num_points, num_dimensions)
17+
with generated points.
1718
"""
1819
rng = np.random.default_rng()
1920
shape = (num_points, num_dimensions)

data_structures/kd_tree/nearest_neighbour_search.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ def nearest_neighbour_search(
99
1010
Args:
1111
root (KDNode | None): The root node of the KD-Tree.
12-
query_point (list[float]): The point for which the nearest neighbor is being searched.
12+
query_point (list[float]): The point for which the nearest neighbor
13+
is being searched.
1314
1415
Returns:
1516
tuple[list[float] | None, float, int]:
16-
- The nearest point found in the KD-Tree to the query point, or None if no point is found.
17+
- The nearest point found in the KD-Tree to the query point,
18+
or None if no point is found.
1719
- The squared distance to the nearest point.
1820
- The number of nodes visited during the search.
1921
"""

0 commit comments

Comments
 (0)