1717
1818class DRangedTree :
1919 def contains (self , point : np .ndarray ):
20- raise NotImplemented
20+ raise NotImplementedError
2121
2222 def depth (self ) -> int :
2323 return 1
24-
24+
2525 def dump (self , space : str ) -> None :
26- raise NotImplemented
27-
26+ raise NotImplementedError
27+
2828 def size (self ) -> int :
2929 return 1
30-
30+
3131 @staticmethod
3232 def build (items : np .ndarray , widths : np .ndarray , expected_fraction : float ) -> DRangedTree :
3333 """
@@ -101,7 +101,7 @@ def depth(self):
101101 return 1 + self .subtree .depth ()
102102 def size (self ):
103103 return 1 + self .subtree .size ()
104-
104+
105105class CheckTree (DRangedTree ):
106106 def __init__ (self , axis : int , value : float , subtree : DRangedTree , continuation : DRangedTree | None = None ):
107107 self .axis = axis
@@ -198,10 +198,10 @@ def __init__(self, dimensions_or_tree: int|TreeState, j: int = -1, drop: bool =
198198
199199 def descend (self , j : int ) -> TreeState :
200200 return TreeState (self , j )
201-
201+
202202 def drop (self , j : int ) -> TreeState :
203203 return TreeState (self , j , drop = True )
204-
204+
205205 def print (self , s : str ) -> None :
206206 if self .logging :
207207 print (self .depth * " " , s )
@@ -247,7 +247,7 @@ def _make_tree_internal(rects: np.ndarray, bounds: np.ndarray, state: TreeState)
247247 sub_bounds = without (bounds , d )
248248 subtree = _make_tree_internal (sub_rects , sub_bounds , state .drop (d ))
249249 return FulfilledTree (subtree , d )
250-
250+
251251 # Check if we need to bound a dimension
252252 for d in range (dimensions ):
253253 if state .descent [d ] == state .bound_dimension_at :
@@ -353,7 +353,7 @@ def make_tree_without_d(d: int, rects):
353353 # Diminishing returns as this parameter is dropped; this seems like reasonable trade-off
354354 # Wherever we split we're hardly going to achieve much, so fall out to a list
355355 return ListTree (rects )
356-
356+
357357 d = best_d
358358 split = splits [d ]
359359
@@ -365,7 +365,7 @@ def make_tree_without_d(d: int, rects):
365365 # We can only get here if we're splitting on classes, and there are only two classes,
366366 # so we can simply split at a point between the two classes.
367367 split_at = np .mean (split )
368- else :
368+ else :
369369 if False and best_classes < 3 :
370370 # Chance there is an overlap here, so let's check and eliminate it if possible
371371 # L L L LL LL
0 commit comments