Skip to content

Commit

Permalink
Remove deprecated min_size parameter from quadtree_on_points (#843)
Browse files Browse the repository at this point in the history
Closes #798.

Authors:
  - Mark Harris (https://github.com/harrism)

Approvers:
  - Paul Taylor (https://github.com/trxcllnt)
  - H. Thomson Comer (https://github.com/thomcom)

URL: #843
  • Loading branch information
harrism authored Dec 6, 2022
1 parent 285c6b8 commit 9ca38c8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 31 deletions.
22 changes: 11 additions & 11 deletions docs/source/user_guide/cuspatial_api_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@
" y_max,\n",
" scale,\n",
" max_depth,\n",
" min_size\n",
" max_size\n",
")\n",
"```\n",
"to create the quadtree object that is used by the `quadtree_point_in_polygon` \n",
Expand All @@ -1130,13 +1130,13 @@
"of `10m` points and `max_depth = 7`, $\\frac{10^6}{4^7}$ points will be most \n",
"efficiently packed into the leaves of the quad tree.\n",
"\n",
"`min_size`: The minimum number of points for a non-leaf quadtree node. As the \n",
"quadtree is generated, a leaf node containing usable index points will be created \n",
"as points are added. If the number of points in this leaf exceeds `min_size`, the \n",
"leaf will be subdivided, with four new leaves added and the original node removed \n",
"from the set of leaves. This number is probably optimized in most datasets by \n",
"making it a significant fraction of the optimal leaf size computation from above. \n",
"Consider $10,000,000 / 4^7 / 4 = 153$.\n",
"`max_size`: The maximum number of points allowed in an internal node before it is\n",
"split into four leaf notes. As the quadtree is generated, a leaf node containing\n",
"usable index points will be created as points are added. If the number of points\n",
"in this leaf exceeds `max_size`, the leaf will be subdivided, with four new\n",
"leaves added and the original node removed from the set of leaves. This number is\n",
"probably optimized in most datasets by making it a significant fraction of the\n",
"optimal leaf size computation from above. Consider $10,000,000 / 4^7 / 4 = 153$.\n",
"\n",
"### [cuspatial.quadtree_on_points](https://docs.rapids.ai/api/cuspatial/nightly/api_docs/spatial.html#cuspatial.quadtree_on_points)"
]
Expand Down Expand Up @@ -1172,7 +1172,7 @@
"y_points = (cupy.random.random(10000000) - 0.5) * 180\n",
"scale = 5\n",
"max_depth = 7\n",
"min_size = 125\n",
"max_size = 125\n",
"point_indices, quadtree = cuspatial.quadtree_on_points(x_points,\n",
" y_points,\n",
" polygons.x.min(),\n",
Expand All @@ -1181,7 +1181,7 @@
" polygons.y.max(),\n",
" scale,\n",
" max_depth,\n",
" min_size)\n",
" max_size)\n",
"print(point_indices.head())\n",
"print(quadtree.head())"
]
Expand Down Expand Up @@ -1307,7 +1307,7 @@
" polygons.y.max(),\n",
" scale,\n",
" max_depth,\n",
" min_size)\n",
" max_size)\n",
"poly_bboxes = cuspatial.linestring_bounding_boxes(\n",
" polygons.ring_offset,\n",
" polygons.x,\n",
Expand Down
21 changes: 1 addition & 20 deletions python/cuspatial/cuspatial/core/spatial/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,7 @@


def quadtree_on_points(
xs,
ys,
x_min,
x_max,
y_min,
y_max,
scale,
max_depth,
max_size,
# Deprecated, renamed to `max_size`
min_size=None,
xs, ys, x_min, x_max, y_min, y_max, scale, max_depth, max_size
):
"""Construct a quadtree from a set of points for a given area-of-interest
bounding box.
Expand Down Expand Up @@ -171,15 +161,6 @@ def quadtree_on_points(
Length: 120, dtype: int32
"""

if min_size is not None and max_size is None:
max_size = min_size
min_size = None
warnings.warn(
"Deprecation warning: `min_size` argument has been renamed to "
"`max_size`. Support for the old name will be removed in the "
"next version."
)

xs, ys = normalize_point_columns(as_column(xs), as_column(ys))
x_min, x_max, y_min, y_max = (
min(x_min, x_max),
Expand Down

0 comments on commit 9ca38c8

Please sign in to comment.