77from math import factorial , sqrt
88from typing import Any , Iterable , Iterator , List , Sequence , Tuple , Union
99
10- import numpy as np
1110import scipy .spatial
1211from numpy import abs as np_abs
1312from numpy import (
2827from numpy .linalg import det as ndet
2928from numpy .linalg import matrix_rank , norm , slogdet , solve
3029
30+ from adaptive .types import Bool
31+
3132try :
3233 from typing import TypeAlias
3334except ImportError :
@@ -61,7 +62,7 @@ def fast_norm(v: tuple[float, ...] | ndarray) -> float:
6162
6263def fast_2d_point_in_simplex (
6364 point : Point , simplex : SimplexPoints , eps : float = 1e-8
64- ) -> bool | np . bool_ :
65+ ) -> Bool :
6566 (p0x , p0y ), (p1x , p1y ), (p2x , p2y ) = simplex
6667 px , py = point
6768
@@ -75,9 +76,7 @@ def fast_2d_point_in_simplex(
7576 return (t >= - eps ) and (s + t <= 1 + eps )
7677
7778
78- def point_in_simplex (
79- point : Point , simplex : SimplexPoints , eps : float = 1e-8
80- ) -> bool | np .bool_ :
79+ def point_in_simplex (point : Point , simplex : SimplexPoints , eps : float = 1e-8 ) -> Bool :
8180 if len (point ) == 2 :
8281 return fast_2d_point_in_simplex (point , simplex , eps )
8382
@@ -424,7 +423,7 @@ def get_reduced_simplex(
424423
425424 def point_in_simplex (
426425 self , point : Point , simplex : Simplex , eps : float = 1e-8
427- ) -> bool | np . bool_ :
426+ ) -> Bool :
428427 vertices = self .get_vertices (simplex )
429428 return point_in_simplex (point , vertices , eps )
430429
@@ -533,7 +532,7 @@ def circumscribed_circle(
533532
534533 def point_in_cicumcircle (
535534 self , pt_index : int , simplex : Simplex , transform : ndarray
536- ) -> bool | np . bool_ :
535+ ) -> Bool :
537536 # return self.fast_point_in_circumcircle(pt_index, simplex, transform)
538537 eps = 1e-8
539538
@@ -611,7 +610,7 @@ def bowyer_watson(
611610 new_triangles = self .vertex_to_simplices [pt_index ]
612611 return bad_triangles - new_triangles , new_triangles - bad_triangles
613612
614- def _simplex_is_almost_flat (self , simplex : Simplex ) -> bool | np . bool_ :
613+ def _simplex_is_almost_flat (self , simplex : Simplex ) -> Bool :
615614 return self ._relative_volume (simplex ) < 1e-8
616615
617616 def _relative_volume (self , simplex : Simplex ) -> float :
0 commit comments