diff --git a/t4_devkit/filtering/compose.py b/t4_devkit/filtering/compose.py index 18c3817..b8eb87b 100644 --- a/t4_devkit/filtering/compose.py +++ b/t4_devkit/filtering/compose.py @@ -3,10 +3,10 @@ from typing import TYPE_CHECKING, Sequence from .functional import ( + FilterByArea, FilterByDistance, FilterByLabel, FilterByNumPoints, - FilterByPosition, FilterBySpeed, FilterByUUID, ) @@ -32,7 +32,7 @@ def __init__(self, params: FilterParams, tf_buffer: TransformBuffer) -> None: FilterByLabel.from_params(params), FilterByUUID.from_params(params), FilterByDistance.from_params(params), - FilterByPosition.from_params(params), + FilterByArea.from_params(params), FilterBySpeed.from_params(params), FilterByNumPoints.from_params(params), ] diff --git a/t4_devkit/filtering/functional.py b/t4_devkit/filtering/functional.py index 86ebca9..e26016c 100644 --- a/t4_devkit/filtering/functional.py +++ b/t4_devkit/filtering/functional.py @@ -18,7 +18,7 @@ "FilterByLabel", "FilterByUUID", "FilterByDistance", - "FilterByPosition", + "FilterByArea", "BoxFilterFunction", ] @@ -139,8 +139,8 @@ def __call__(self, box: BoxType, tf_matrix: HomogeneousMatrix) -> bool: return self.min_distance < box_distance and box_distance < self.max_distance -class FilterByPosition(BaseBoxFilter): - """Filter a box by checking if the box xy position is within the specified xy position. +class FilterByArea(BaseBoxFilter): + """Filter a box by checking if the box xy position is within the specified xy area. Note that, the type box is `Box2D` and its `position` is None, these boxes pass through this filter. diff --git a/tests/fitering/test_filter_function.py b/tests/fitering/test_filter_function.py index 522da66..14c0b6d 100644 --- a/tests/fitering/test_filter_function.py +++ b/tests/fitering/test_filter_function.py @@ -1,8 +1,8 @@ from t4_devkit.filtering.functional import ( + FilterByArea, FilterByDistance, FilterByLabel, FilterByNumPoints, - FilterByPosition, FilterBySpeed, FilterByUUID, ) @@ -67,14 +67,14 @@ def test_filter_by_distance(dummy_box3ds, dummy_box2ds, dummy_tf_buffer) -> None def test_filter_by_position(dummy_box3ds, dummy_box2ds, dummy_tf_buffer) -> None: - """Test `FilterByPosition`. + """Test `FilterByArea`. Args: dummy_box3ds (list[Box3D]): List of 3D boxes. dummy_box2ds (list[Box2D]): List of 2D boxes. dummy_tf_buffer (TransformBuffer): Transformation buffer. """ - box_filter = FilterByPosition(min_xy=(0.0, 0.0), max_xy=(10.0, 10.0)) + box_filter = FilterByArea(min_xy=(0.0, 0.0), max_xy=(10.0, 10.0)) answer3d = [ box