Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
alavenant committed May 29, 2024
1 parent a606882 commit 8ff93f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/test_radius_assign.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


def distance2d(pt1, pt2):
return sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2)
return round(sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2), 2)


def distance3d(pt1, pt2):
return sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2 + (pt1[2] - pt2[2]) ** 2)
return round(sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] - pt2[1]) ** 2 + (pt1[2] - pt2[2]) ** 2), 2)

def run_filter(arrays_las, distance_radius, search_3d, distance_cylinder=0. ):

Expand All @@ -40,8 +40,8 @@ def run_filter(arrays_las, distance_radius, search_3d, distance_cylinder=0. ):
{
"type": "filters.assign",
"value": [
"SRS_DOMAIN = 1 WHERE Classification==2",
"SRS_DOMAIN = 0 WHERE Classification!=2",
"SRC_DOMAIN = 1 WHERE Classification==2",
"SRC_DOMAIN = 0 WHERE Classification!=2",
"REF_DOMAIN = 1 WHERE Classification==1",
"REF_DOMAIN = 0 WHERE Classification!=1",
],
Expand Down Expand Up @@ -137,7 +137,7 @@ def test_radius_assign_2d_cylinder():
def func_test(pt_ini, pt):
distance_i = distance2d(pt_ini, pt)
if distance_i <= distance_radius:
if abs(pt_ini[2] - pt[2]) <= distance_cylinder:
if abs(pt_ini[2] - pt[2]) < distance_cylinder:
return 1
return 0

Expand Down

0 comments on commit 8ff93f0

Please sign in to comment.