validate: fix track and duplicate point validation
This commit is contained in:
@@ -64,22 +64,24 @@ def validate_no_duplicate_points_in_tracks() -> list:
|
||||
for marker_set in marker_sets:
|
||||
for marker in marker_set.markers:
|
||||
if isinstance(marker, Track):
|
||||
points = {}
|
||||
for point in marker.points:
|
||||
if point in points:
|
||||
for p1, p2 in zip(marker.points, marker.points[1:]):
|
||||
if p1 == p2:
|
||||
result.append(
|
||||
{
|
||||
"error_type": "duplicate_point",
|
||||
"point_a": points[point],
|
||||
"point_a": (
|
||||
world_name,
|
||||
marker_set.name,
|
||||
marker.name,
|
||||
),
|
||||
"point_b": (
|
||||
world_name,
|
||||
marker_set.name,
|
||||
marker.name,
|
||||
),
|
||||
"coordinates": point,
|
||||
"coordinates": p1,
|
||||
}
|
||||
)
|
||||
points[point] = (world_name, marker_set.name, marker.name)
|
||||
|
||||
return result
|
||||
|
||||
@@ -146,23 +148,6 @@ def validate_no_duplicate_points() -> list:
|
||||
}
|
||||
)
|
||||
points[point] = (world_name, marker_set.name, marker.name)
|
||||
elif isinstance(marker, Track):
|
||||
for i, point in enumerate(marker.points):
|
||||
if point in points:
|
||||
result.append(
|
||||
{
|
||||
"error_type": "duplicate_point",
|
||||
"point_a": points[point],
|
||||
"point_b": (
|
||||
world_name,
|
||||
marker_set.name,
|
||||
marker.name,
|
||||
),
|
||||
"index": i,
|
||||
"coordinates": point,
|
||||
}
|
||||
)
|
||||
points[point] = (world_name, marker_set.name, marker.name)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user