_qhull.pyi 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. '''
  2. Static type checking stub file for scipy/spatial/qhull.pyx
  3. '''
  4. from typing import List, Tuple, Any, Dict
  5. import numpy as np
  6. from numpy.typing import ArrayLike, NDArray
  7. from typing_extensions import final
  8. class QhullError(RuntimeError):
  9. ...
  10. @final
  11. class _Qhull:
  12. # Read-only cython attribute that behaves, more or less, like a property
  13. @property
  14. def ndim(self) -> int: ...
  15. mode_option: bytes
  16. options: bytes
  17. furthest_site: bool
  18. def __init__(
  19. self,
  20. mode_option: bytes,
  21. points: NDArray[np.float64],
  22. options: None | bytes = ...,
  23. required_options: None | bytes = ...,
  24. furthest_site: bool = ...,
  25. incremental: bool = ...,
  26. interior_point: None | NDArray[np.float64] = ...,
  27. ) -> None: ...
  28. def check_active(self) -> None: ...
  29. def close(self) -> None: ...
  30. def get_points(self) -> NDArray[np.float64]: ...
  31. def add_points(
  32. self,
  33. points: ArrayLike,
  34. interior_point: ArrayLike = ...
  35. ) -> None: ...
  36. def get_paraboloid_shift_scale(self) -> Tuple[float, float]: ...
  37. def volume_area(self) -> Tuple[float, float]: ...
  38. def triangulate(self) -> None: ...
  39. def get_simplex_facet_array(self) -> Tuple[
  40. NDArray[np.intc],
  41. NDArray[np.intc],
  42. NDArray[np.float64],
  43. NDArray[np.intc],
  44. NDArray[np.intc],
  45. ]: ...
  46. def get_hull_points(self) -> NDArray[np.float64]: ...
  47. def get_hull_facets(self) -> Tuple[
  48. List[List[int]],
  49. NDArray[np.float64],
  50. ]: ...
  51. def get_voronoi_diagram(self) -> Tuple[
  52. NDArray[np.float64],
  53. NDArray[np.intc],
  54. List[List[int]],
  55. List[List[int]],
  56. NDArray[np.intp],
  57. ]: ...
  58. def get_extremes_2d(self) -> NDArray[np.intc]: ...
  59. def _get_barycentric_transforms(
  60. points: NDArray[np.float64],
  61. simplices: NDArray[np.int_],
  62. eps: float
  63. ) -> NDArray[np.float64]: ...
  64. class _QhullUser:
  65. ndim: int
  66. npoints: int
  67. min_bound: NDArray[np.float64]
  68. max_bound: NDArray[np.float64]
  69. def __init__(self, qhull: _Qhull, incremental: bool = ...) -> None: ...
  70. def close(self) -> None: ...
  71. def _update(self, qhull: _Qhull) -> None: ...
  72. def _add_points(
  73. self,
  74. points: ArrayLike,
  75. restart: bool = ...,
  76. interior_point: ArrayLike = ...
  77. ) -> None: ...
  78. class Delaunay(_QhullUser):
  79. furthest_site: bool
  80. paraboloid_scale: float
  81. paraboloid_shift: float
  82. simplices: NDArray[np.intc]
  83. neighbors: NDArray[np.intc]
  84. equations: NDArray[np.float64]
  85. coplanar: NDArray[np.intc]
  86. good: NDArray[np.intc]
  87. nsimplex: int
  88. vertices: NDArray[np.intc]
  89. def __init__(
  90. self,
  91. points: ArrayLike,
  92. furthest_site: bool = ...,
  93. incremental: bool = ...,
  94. qhull_options: None | str = ...
  95. ) -> None: ...
  96. def _update(self, qhull: _Qhull) -> None: ...
  97. def add_points(
  98. self,
  99. points: ArrayLike,
  100. restart: bool = ...
  101. ) -> None: ...
  102. @property
  103. def points(self) -> NDArray[np.float64]: ...
  104. @property
  105. def transform(self) -> NDArray[np.float64]: ...
  106. @property
  107. def vertex_to_simplex(self) -> NDArray[np.intc]: ...
  108. @property
  109. def vertex_neighbor_vertices(self) -> Tuple[
  110. NDArray[np.intc],
  111. NDArray[np.intc],
  112. ]: ...
  113. @property
  114. def convex_hull(self) -> NDArray[np.intc]: ...
  115. def find_simplex(
  116. self,
  117. xi: ArrayLike,
  118. bruteforce: bool = ...,
  119. tol: float = ...
  120. ) -> NDArray[np.intc]: ...
  121. def plane_distance(self, xi: ArrayLike) -> NDArray[np.float64]: ...
  122. def lift_points(self, x: ArrayLike) -> NDArray[np.float64]: ...
  123. def tsearch(tri: Delaunay, xi: ArrayLike) -> NDArray[np.intc]: ...
  124. def _copy_docstr(dst: object, src: object) -> None: ...
  125. class ConvexHull(_QhullUser):
  126. simplices: NDArray[np.intc]
  127. neighbors: NDArray[np.intc]
  128. equations: NDArray[np.float64]
  129. coplanar: NDArray[np.intc]
  130. good: None | NDArray[np.bool_]
  131. volume: float
  132. area: float
  133. nsimplex: int
  134. def __init__(
  135. self,
  136. points: ArrayLike,
  137. incremental: bool = ...,
  138. qhull_options: None | str = ...
  139. ) -> None: ...
  140. def _update(self, qhull: _Qhull) -> None: ...
  141. def add_points(self, points: ArrayLike,
  142. restart: bool = ...) -> None: ...
  143. @property
  144. def points(self) -> NDArray[np.float64]: ...
  145. @property
  146. def vertices(self) -> NDArray[np.intc]: ...
  147. class Voronoi(_QhullUser):
  148. vertices: NDArray[np.float64]
  149. ridge_points: NDArray[np.intc]
  150. ridge_vertices: List[List[int]]
  151. regions: List[List[int]]
  152. point_region: NDArray[np.intp]
  153. furthest_site: bool
  154. def __init__(
  155. self,
  156. points: ArrayLike,
  157. furthest_site: bool = ...,
  158. incremental: bool = ...,
  159. qhull_options: None | str = ...
  160. ) -> None: ...
  161. def _update(self, qhull: _Qhull) -> None: ...
  162. def add_points(
  163. self,
  164. points: ArrayLike,
  165. restart: bool = ...
  166. ) -> None: ...
  167. @property
  168. def points(self) -> NDArray[np.float64]: ...
  169. @property
  170. def ridge_dict(self) -> Dict[Tuple[int, int], List[int]]: ...
  171. class HalfspaceIntersection(_QhullUser):
  172. interior_point: NDArray[np.float64]
  173. dual_facets: List[List[int]]
  174. dual_equations: NDArray[np.float64]
  175. dual_points: NDArray[np.float64]
  176. dual_volume: float
  177. dual_area: float
  178. intersections: NDArray[np.float64]
  179. ndim: int
  180. nineq: int
  181. def __init__(
  182. self,
  183. halfspaces: ArrayLike,
  184. interior_point: ArrayLike,
  185. incremental: bool = ...,
  186. qhull_options: None | str = ...
  187. ) -> None: ...
  188. def _update(self, qhull: _Qhull) -> None: ...
  189. def add_halfspaces(
  190. self,
  191. halfspaces: ArrayLike,
  192. restart: bool = ...
  193. ) -> None: ...
  194. @property
  195. def halfspaces(self) -> NDArray[np.float64]: ...
  196. @property
  197. def dual_vertices(self) -> NDArray[np.int_]: ...