mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-04 15:56:08 +08:00
print invalid reason
This commit is contained in:
@@ -80,6 +80,14 @@ class PointBuckets:
|
||||
def is_valid(self) -> bool:
|
||||
individual_buckets_valid = all(len(v) >= min_pts for v, min_pts in zip(self.buckets.values(), self.buckets_min_points.values(), strict=True))
|
||||
total_points_valid = self.__len__() >= self.min_points_total
|
||||
|
||||
if not individual_buckets_valid:
|
||||
for bounds, (bucket, min_pts) in zip(self.x_bounds, zip(self.buckets.values(), self.buckets_min_points.values())):
|
||||
if len(bucket) < min_pts:
|
||||
print(f"Bucket {bounds} is invalid: has {len(bucket)} points, requires at least {min_pts} points.")
|
||||
if not total_points_valid:
|
||||
print(f"Total points are invalid: has {self.__len__()} points, requires at least {self.min_points_total} points.")
|
||||
|
||||
return individual_buckets_valid and total_points_valid
|
||||
|
||||
def is_calculable(self) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user