11from collections .abc import Callable , Generator , Sequence
2- from typing import Concatenate , Final , Generic , TypeAlias
2+ from typing import Concatenate , Final , Generic , Protocol , TypeAlias , type_check_only
33from typing_extensions import TypeVar
44
55import numpy as np
@@ -23,6 +23,10 @@ _Symmetry: TypeAlias = onp.ArrayND[npc.integer] | op.CanGetitem[int, op.CanIndex
2323
2424_HT = TypeVar ("_HT" , bound = VertexCacheBase , default = VertexCacheBase )
2525
26+ @type_check_only
27+ class SplitEdgeFunction (Protocol ):
28+ def __call__ (self , / , v1 : VertexBase , v2 : VertexBase ) -> VertexBase : ...
29+
2630###
2731
2832class Complex (Generic [_HT ]): # undocumented
@@ -49,6 +53,9 @@ class Complex(Generic[_HT]): # undocumented
4953 cp : Generator [_Floats , None , _Floats ]
5054 rls : Generator [VertexBase | _Floats ]
5155
56+ # awkward annotation for `self.split_edge = functools.cache(self._split_edge)`
57+ split_edge : Final [SplitEdgeFunction ]
58+
5259 def __init__ (
5360 self ,
5461 / ,
@@ -78,7 +85,7 @@ class Complex(Generic[_HT]): # undocumented
7885 self , / , origin : _Location , supremum : _Location , bounds : _Bounds , centroid : onp .ToBool = 1
7986 ) -> Generator [VertexBase | _Floats ]: ...
8087 def refine_star (self , / , v : VertexBase ) -> None : ...
81- def split_edge (self , / , v1 : VertexBase , v2 : VertexBase ) -> VertexBase : ...
88+ def _split_edge (self , / , v1 : VertexBase , v2 : VertexBase ) -> VertexBase : ...
8289 def vpool (self , / , origin : _Location , supremum : _Location ) -> set [VertexBase ]: ...
8390 def vf_to_vv (self , / , vertices : Sequence [VertexBase ], simplices : Sequence [tuple [onp .ToFloat1D , onp .ToFloat1D ]]) -> None : ...
8491 def connect_vertex_non_symm (
0 commit comments