Skip to content

Commit

Permalink
refactor: rename FilterByAre to FilterByRegion (#72)
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 authored Dec 25, 2024
1 parent 6c0ea2e commit aadb39c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions t4_devkit/filtering/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from typing import TYPE_CHECKING, Sequence

from .functional import (
FilterByArea,
FilterByDistance,
FilterByLabel,
FilterByNumPoints,
FilterByRegion,
FilterBySpeed,
FilterByUUID,
)
Expand All @@ -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),
FilterByArea.from_params(params),
FilterByRegion.from_params(params),
FilterBySpeed.from_params(params),
FilterByNumPoints.from_params(params),
]
Expand Down
6 changes: 3 additions & 3 deletions t4_devkit/filtering/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"FilterByLabel",
"FilterByUUID",
"FilterByDistance",
"FilterByArea",
"FilterByRegion",
"BoxFilterFunction",
]

Expand Down Expand Up @@ -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 FilterByArea(BaseBoxFilter):
"""Filter a box by checking if the box xy position is within the specified xy area.
class FilterByRegion(BaseBoxFilter):
"""Filter a box by checking if the box xy position is within the specified xy region.
Note that, the type box is `Box2D` and its `position` is None,
these boxes pass through this filter.
Expand Down
8 changes: 4 additions & 4 deletions tests/fitering/test_filter_function.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from t4_devkit.filtering.functional import (
FilterByArea,
FilterByDistance,
FilterByLabel,
FilterByNumPoints,
FilterByRegion,
FilterBySpeed,
FilterByUUID,
)
Expand Down Expand Up @@ -66,15 +66,15 @@ def test_filter_by_distance(dummy_box3ds, dummy_box2ds, dummy_tf_buffer) -> None
assert len(answer2d) == 3


def test_filter_by_position(dummy_box3ds, dummy_box2ds, dummy_tf_buffer) -> None:
"""Test `FilterByArea`.
def test_filter_by_Region(dummy_box3ds, dummy_box2ds, dummy_tf_buffer) -> None:
"""Test `FilterByRegion`.
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 = FilterByArea(min_xy=(0.0, 0.0), max_xy=(10.0, 10.0))
box_filter = FilterByRegion(min_xy=(0.0, 0.0), max_xy=(10.0, 10.0))

answer3d = [
box
Expand Down

0 comments on commit aadb39c

Please sign in to comment.