1
1
from 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
3
3
from typing_extensions import TypeVar
4
4
5
5
import numpy as np
@@ -23,6 +23,10 @@ _Symmetry: TypeAlias = onp.ArrayND[npc.integer] | op.CanGetitem[int, op.CanIndex
23
23
24
24
_HT = TypeVar ("_HT" , bound = VertexCacheBase , default = VertexCacheBase )
25
25
26
+ @type_check_only
27
+ class SplitEdgeFunction (Protocol ):
28
+ def __call__ (self , / , v1 : VertexBase , v2 : VertexBase ) -> VertexBase : ...
29
+
26
30
###
27
31
28
32
class Complex (Generic [_HT ]): # undocumented
@@ -49,6 +53,9 @@ class Complex(Generic[_HT]): # undocumented
49
53
cp : Generator [_Floats , None , _Floats ]
50
54
rls : Generator [VertexBase | _Floats ]
51
55
56
+ # awkward annotation for `self.split_edge = functools.cache(self._split_edge)`
57
+ split_edge : Final [SplitEdgeFunction ]
58
+
52
59
def __init__ (
53
60
self ,
54
61
/ ,
@@ -78,7 +85,7 @@ class Complex(Generic[_HT]): # undocumented
78
85
self , / , origin : _Location , supremum : _Location , bounds : _Bounds , centroid : onp .ToBool = 1
79
86
) -> Generator [VertexBase | _Floats ]: ...
80
87
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 : ...
82
89
def vpool (self , / , origin : _Location , supremum : _Location ) -> set [VertexBase ]: ...
83
90
def vf_to_vv (self , / , vertices : Sequence [VertexBase ], simplices : Sequence [tuple [onp .ToFloat1D , onp .ToFloat1D ]]) -> None : ...
84
91
def connect_vertex_non_symm (
0 commit comments