print invalid reason

This commit is contained in:
MoreTore
2025-05-13 23:23:22 -05:00
parent 669b80fcec
commit c48510c2c2
+8
View File
@@ -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: