Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 414b639

Browse files
committed
TYP: Add typing for internal _tri extension
1 parent 3eda5a3 commit 414b639

File tree

1 file changed

+26
-16
lines changed

1 file changed

+26
-16
lines changed

lib/matplotlib/_tri.pyi

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
11
# This is a private module implemented in C++
2-
# As such these type stubs are overly generic, but here to allow these types
3-
# as return types for public methods
4-
from typing import Any, final
2+
from typing import final
3+
4+
import numpy as np
5+
import numpy.typing as npt
56

67
@final
78
class TrapezoidMapTriFinder:
8-
def __init__(self, *args, **kwargs) -> None: ...
9-
def find_many(self, *args, **kwargs) -> Any: ...
10-
def get_tree_stats(self, *args, **kwargs) -> Any: ...
11-
def initialize(self, *args, **kwargs) -> Any: ...
12-
def print_tree(self, *args, **kwargs) -> Any: ...
9+
def __init__(self, triangulation: Triangulation) -> None: ...
10+
def find_many(self, x: npt.NDArray[np.float64], y: npt.NDArray[np.float64]) -> npt.NDArray[np.int_]: ...
11+
def get_tree_stats(self) -> list[int | float]: ...
12+
def initialize(self) -> None: ...
13+
def print_tree(self) -> None: ...
1314

1415
@final
1516
class TriContourGenerator:
16-
def __init__(self, *args, **kwargs) -> None: ...
17-
def create_contour(self, *args, **kwargs) -> Any: ...
18-
def create_filled_contour(self, *args, **kwargs) -> Any: ...
17+
def __init__(self, triangulation: Triangulation, z: npt.NDArray[np.float64]) -> None: ...
18+
def create_contour(self, level: float) -> tuple[list[float], list[int]]: ...
19+
def create_filled_contour(self, lower_level: float, upper_level: float) -> tuple[list[float], list[int]]: ...
1920

2021
@final
2122
class Triangulation:
22-
def __init__(self, *args, **kwargs) -> None: ...
23-
def calculate_plane_coefficients(self, *args, **kwargs) -> Any: ...
24-
def get_edges(self, *args, **kwargs) -> Any: ...
25-
def get_neighbors(self, *args, **kwargs) -> Any: ...
26-
def set_mask(self, *args, **kwargs) -> Any: ...
23+
def __init__(
24+
self,
25+
x: npt.NDArray[np.float64],
26+
y: npt.NDArray[np.float64],
27+
triangles: npt.NDArray[np.int_],
28+
mask: npt.NDArray[np.bool_],
29+
edges: npt.NDArray[np.int_],
30+
neighbors: npt.NDArray[np.int_],
31+
correct_triangle_orientation: bool,
32+
) -> None: ...
33+
def calculate_plane_coefficients(self, z: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]: ...
34+
def get_edges(self) -> npt.NDArray[np.int_]: ...
35+
def get_neighbors(self) -> npt.NDArray[np.int_]: ...
36+
def set_mask(self, mask: npt.NDArray[np.bool_]) -> None: ...

0 commit comments

Comments
 (0)