File size: 7,111 Bytes
fe41391 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
from __future__ import annotations
from typing import ClassVar, NoReturn
import numpy as np
import numpy.typing as npt
from typing_extensions import TypeAlias
import contourpy._contourpy as cpy
# Input numpy array types, the same as in common.h
CoordinateArray: TypeAlias = npt.NDArray[np.float64]
MaskArray: TypeAlias = npt.NDArray[np.bool_]
# Output numpy array types, the same as in common.h
PointArray: TypeAlias = npt.NDArray[np.float64]
CodeArray: TypeAlias = npt.NDArray[np.uint8]
OffsetArray: TypeAlias = npt.NDArray[np.uint32]
# Types returned from filled()
FillReturn_OuterCode: TypeAlias = tuple[list[PointArray], list[CodeArray]]
FillReturn_OuterOffset: TypeAlias = tuple[list[PointArray], list[OffsetArray]]
FillReturn_ChunkCombinedCode: TypeAlias = tuple[list[PointArray | None], list[CodeArray | None]]
FillReturn_ChunkCombinedOffset: TypeAlias = tuple[list[PointArray | None], list[OffsetArray | None]]
FillReturn_ChunkCombinedCodeOffset: TypeAlias = tuple[list[PointArray | None], list[CodeArray | None], list[OffsetArray | None]]
FillReturn_ChunkCombinedOffsetOffset: TypeAlias = tuple[list[PointArray | None], list[OffsetArray | None], list[OffsetArray | None]]
FillReturn_Chunk: TypeAlias = FillReturn_ChunkCombinedCode | FillReturn_ChunkCombinedOffset | FillReturn_ChunkCombinedCodeOffset | FillReturn_ChunkCombinedOffsetOffset
FillReturn: TypeAlias = FillReturn_OuterCode | FillReturn_OuterOffset | FillReturn_Chunk
# Types returned from lines()
LineReturn_Separate: TypeAlias = list[PointArray]
LineReturn_SeparateCode: TypeAlias = tuple[list[PointArray], list[CodeArray]]
LineReturn_ChunkCombinedCode: TypeAlias = tuple[list[PointArray | None], list[CodeArray | None]]
LineReturn_ChunkCombinedOffset: TypeAlias = tuple[list[PointArray | None], list[OffsetArray | None]]
LineReturn_ChunkCombinedNan: TypeAlias = tuple[list[PointArray | None]]
LineReturn_Chunk: TypeAlias = LineReturn_ChunkCombinedCode | LineReturn_ChunkCombinedOffset | LineReturn_ChunkCombinedNan
LineReturn: TypeAlias = LineReturn_Separate | LineReturn_SeparateCode | LineReturn_Chunk
NDEBUG: int
__version__: str
class FillType:
ChunkCombinedCode: ClassVar[cpy.FillType]
ChunkCombinedCodeOffset: ClassVar[cpy.FillType]
ChunkCombinedOffset: ClassVar[cpy.FillType]
ChunkCombinedOffsetOffset: ClassVar[cpy.FillType]
OuterCode: ClassVar[cpy.FillType]
OuterOffset: ClassVar[cpy.FillType]
__members__: ClassVar[dict[str, cpy.FillType]]
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __init__(self, value: int) -> None: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __repr__(self) -> str: ...
def __setstate__(self, state: int) -> NoReturn: ...
@property
def name(self) -> str: ...
@property
def value(self) -> int: ...
class LineType:
ChunkCombinedCode: ClassVar[cpy.LineType]
ChunkCombinedNan: ClassVar[cpy.LineType]
ChunkCombinedOffset: ClassVar[cpy.LineType]
Separate: ClassVar[cpy.LineType]
SeparateCode: ClassVar[cpy.LineType]
__members__: ClassVar[dict[str, cpy.LineType]]
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __init__(self, value: int) -> None: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __repr__(self) -> str: ...
def __setstate__(self, state: int) -> NoReturn: ...
@property
def name(self) -> str: ...
@property
def value(self) -> int: ...
class ZInterp:
Linear: ClassVar[cpy.ZInterp]
Log: ClassVar[cpy.ZInterp]
__members__: ClassVar[dict[str, cpy.ZInterp]]
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __init__(self, value: int) -> None: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __repr__(self) -> str: ...
def __setstate__(self, state: int) -> NoReturn: ...
@property
def name(self) -> str: ...
@property
def value(self) -> int: ...
def max_threads() -> int: ...
class ContourGenerator:
def create_contour(self, level: float) -> LineReturn: ...
def create_filled_contour(self, lower_level: float, upper_level: float) -> FillReturn: ...
def filled(self, lower_level: float, upper_level: float) -> FillReturn: ...
def lines(self, level: float) -> LineReturn: ...
@staticmethod
def supports_corner_mask() -> bool: ...
@staticmethod
def supports_fill_type(fill_type: FillType) -> bool: ...
@staticmethod
def supports_line_type(line_type: LineType) -> bool: ...
@staticmethod
def supports_quad_as_tri() -> bool: ...
@staticmethod
def supports_threads() -> bool: ...
@staticmethod
def supports_z_interp() -> bool: ...
@property
def chunk_count(self) -> tuple[int, int]: ...
@property
def chunk_size(self) -> tuple[int, int]: ...
@property
def corner_mask(self) -> bool: ...
@property
def fill_type(self) -> FillType: ...
@property
def line_type(self) -> LineType: ...
@property
def quad_as_tri(self) -> bool: ...
@property
def thread_count(self) -> int: ...
@property
def z_interp(self) -> ZInterp: ...
default_fill_type: cpy.FillType
default_line_type: cpy.LineType
class Mpl2005ContourGenerator(ContourGenerator):
def __init__(
self,
x: CoordinateArray,
y: CoordinateArray,
z: CoordinateArray,
mask: MaskArray,
*,
x_chunk_size: int = 0,
y_chunk_size: int = 0,
) -> None: ...
class Mpl2014ContourGenerator(ContourGenerator):
def __init__(
self,
x: CoordinateArray,
y: CoordinateArray,
z: CoordinateArray,
mask: MaskArray,
*,
corner_mask: bool,
x_chunk_size: int = 0,
y_chunk_size: int = 0,
) -> None: ...
class SerialContourGenerator(ContourGenerator):
def __init__(
self,
x: CoordinateArray,
y: CoordinateArray,
z: CoordinateArray,
mask: MaskArray,
*,
corner_mask: bool,
line_type: LineType,
fill_type: FillType,
quad_as_tri: bool,
z_interp: ZInterp,
x_chunk_size: int = 0,
y_chunk_size: int = 0,
) -> None: ...
def _write_cache(self) -> NoReturn: ...
class ThreadedContourGenerator(ContourGenerator):
def __init__(
self,
x: CoordinateArray,
y: CoordinateArray,
z: CoordinateArray,
mask: MaskArray,
*,
corner_mask: bool,
line_type: LineType,
fill_type: FillType,
quad_as_tri: bool,
z_interp: ZInterp,
x_chunk_size: int = 0,
y_chunk_size: int = 0,
thread_count: int = 0,
) -> None: ...
def _write_cache(self) -> None: ...
|