forked from microsoft/python-type-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtransforms.pyi
More file actions
398 lines (365 loc) · 13.5 KB
/
transforms.pyi
File metadata and controls
398 lines (365 loc) · 13.5 KB
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
from collections.abc import Sequence
from typing import Literal
import numpy as np
from matplotlib._typing import *
from matplotlib.figure import Figure
from matplotlib.patches import Patch
from matplotlib.path import Path
DEBUG = ...
class TransformNode:
INVALID_NON_AFFINE = ...
INVALID_AFFINE = ...
INVALID = ...
is_affine = ...
is_bbox = ...
pass_through = ...
def __init__(self, shorthand_name: str = ...) -> None: ...
def __getstate__(self): ...
def __setstate__(self, data_dict): ...
def __copy__(self): ...
def invalidate(self): ...
def set_children(self, *children): ...
def frozen(self): ...
class BboxBase(TransformNode):
is_bbox = ...
is_affine = ...
def frozen(self): ...
def __array__(self, *args, **kwargs): ...
@property
def x0(self) -> float: ...
@property
def y0(self) -> float: ...
@property
def x1(self) -> float: ...
@property
def y1(self) -> float: ...
@property
def p0(self) -> tuple[float, float]: ...
@property
def p1(self) -> tuple[float, float]: ...
@property
def xmin(self) -> float: ...
@property
def ymin(self) -> float: ...
@property
def xmax(self) -> float: ...
@property
def ymax(self) -> float: ...
@property
def min(self) -> tuple[float, float]: ...
@property
def max(self) -> tuple[float, float]: ...
@property
def intervalx(self) -> tuple[float, float]: ...
@property
def intervaly(self) -> tuple[float, float]: ...
@property
def width(self) -> float: ...
@property
def height(self) -> float: ...
@property
def size(self) -> tuple[float, float]: ...
@property
def bounds(self) -> tuple[float, float, float, float]: ...
@property
def extents(self) -> tuple[float, float, float, float]: ...
def get_points(self): ...
def containsx(self, x) -> bool: ...
def containsy(self, y) -> bool: ...
def contains(self, x, y) -> bool: ...
def overlaps(self, other: BboxBase) -> bool: ...
def fully_containsx(self, x: float) -> bool: ...
def fully_containsy(self, y: float) -> bool: ...
def fully_contains(self, x: float, y: float) -> bool: ...
def fully_overlaps(self, other: BboxBase) -> bool: ...
def transformed(self, transform: Transform): ...
coefs = ...
def anchored(
self,
c: Sequence[float] | Literal["C", "SW", "S", "SE", "E", "NE", "N", "NW", "W"],
container: Bbox = ...,
): ...
def shrunk(self, mx: float, my: float) -> Bbox: ...
def shrunk_to_aspect(self, box_aspect: float, container=..., fig_aspect: float = ...) -> Bbox: ...
def splitx(self, *args) -> list[Bbox]: ...
def splity(self, *args) -> list[Bbox]: ...
def count_contains(self, vertices) -> int: ...
def count_overlaps(self, bboxes: Sequence[Bbox]) -> int: ...
def expanded(self, sw: float, sh: float) -> Bbox: ...
def padded(self, p: float) -> Bbox: ...
def translated(self, tx: float, ty: float) -> Bbox: ...
def corners(
self,
) -> tuple[
tuple[float, float],
tuple[float, float],
tuple[float, float],
tuple[float, float],
]: ...
def rotated(self, radians: float) -> Bbox: ...
@staticmethod
def union(bboxes: Sequence[Bbox]) -> Bbox: ...
@staticmethod
def intersection(bbox1: Bbox, bbox2: Bbox) -> None | Bbox: ...
class Bbox(BboxBase):
def __init__(self, points: np.ndarray, **kwargs) -> None: ...
def invalidate(self): ...
def frozen(self): ...
@staticmethod
def unit() -> Bbox: ...
@staticmethod
def null() -> Bbox: ...
@staticmethod
def from_bounds(x0: float, y0: float, width: float, height: float) -> Bbox: ...
@staticmethod
def from_extents(*args, minpos: float | None = ...): ...
def __format__(self, fmt: str): ...
def ignore(self, value: bool): ...
def update_from_path(
self,
path: Path,
ignore: bool | None = ...,
updatex: bool = True,
updatey: bool = True,
): ...
def update_from_data_x(self, x: np.ndarray, ignore: bool | None = ...): ...
def update_from_data_y(self, y: np.ndarray, ignore: bool | None = ...): ...
def update_from_data_xy(
self,
xy: np.ndarray,
ignore: bool | None = ...,
updatex: bool = True,
updatey: bool = True,
): ...
@BboxBase.x0.setter
def x0(self, val: float): ...
@BboxBase.y0.setter
def y0(self, val: float): ...
@BboxBase.x1.setter
def x1(self, val: float): ...
@BboxBase.y1.setter
def y1(self, val: float): ...
@BboxBase.p0.setter
def p0(self, val: float): ...
@BboxBase.p1.setter
def p1(self, val: float): ...
@BboxBase.intervalx.setter
def intervalx(self, interval): ...
@BboxBase.intervaly.setter
def intervaly(self, interval): ...
@BboxBase.bounds.setter
def bounds(self, bounds): ...
@property
def minpos(self) -> float: ...
@property
def minposx(self) -> float: ...
@property
def minposy(self) -> float: ...
def get_points(self) -> tuple[tuple[float, float], tuple[float, float]]: ...
def set_points(self, points) -> tuple[tuple[float, float], tuple[float, float]]: ...
def set(self, other: Bbox): ...
def mutated(self) -> bool: ...
def mutatedx(self) -> bool: ...
def mutatedy(self) -> bool: ...
class TransformedBbox(BboxBase):
def __init__(self, bbox: Bbox, transform: Transform, **kwargs) -> None: ...
def get_points(self): ...
class LockableBbox(BboxBase):
def __init__(
self, bbox: Bbox, x0: float | None = ..., y0: float | None = ..., x1: float | None = ..., y1: float | None = ..., **kwargs
) -> None: ...
def get_points(self): ...
@property
def locked_x0(self) -> float | None: ...
@locked_x0.setter
def locked_x0(self, x0: float | None): ...
@property
def locked_y0(self) -> float | None: ...
@locked_y0.setter
def locked_y0(self, y0: float | None): ...
@property
def locked_x1(self) -> float | None: ...
@locked_x1.setter
def locked_x1(self, x1: float | None): ...
@property
def locked_y1(self) -> float | None: ...
@locked_y1.setter
def locked_y1(self, y1: float | None): ...
class Transform(TransformNode):
input_dims = ...
output_dims = ...
is_separable = ...
has_inverse = ...
def __init_subclass__(cls) -> None: ...
def __add__(self, other: Transform) -> Transform: ...
@property
def depth(self) -> int: ...
def contains_branch(self, other: Transform): ...
def contains_branch_seperately(self, other_transform: Transform): ...
def __sub__(self, other: Transform) -> Transform: ...
def __array__(self, *args, **kwargs): ...
def transform(self, values: ArrayLike) -> np.ndarray: ...
def transform_affine(self, values: ArrayLike) -> np.ndarray: ...
def transform_non_affine(self, values: ArrayLike) -> np.ndarray: ...
def transform_bbox(self, bbox: Bbox): ...
def get_affine(self): ...
def get_matrix(self): ...
def transform_point(self, point): ...
def transform_path(self, path: Path) -> Path: ...
def transform_path_affine(self, path: Path) -> Path: ...
def transform_path_non_affine(self, path: Path) -> Path: ...
def transform_angles(
self,
angles: ArrayLike,
pts: ArrayLike,
radians: bool = ...,
pushoff: float = ...,
) -> np.ndarray: ...
def inverted(self) -> Transform: ...
class TransformWrapper(Transform):
pass_through = ...
def __init__(self, child: Transform) -> None: ...
def __eq__(self, other: Transform) -> bool: ...
def frozen(self): ...
def set(self, child: Transform): ...
is_affine = ...
is_separable = ...
has_inverse = ...
class AffineBase(Transform):
is_affine = ...
def __init__(self, *args, **kwargs) -> None: ...
def __array__(self, *args, **kwargs): ...
def __eq__(self, other) -> bool: ...
def transform(self, values: ArrayLike) -> np.ndarray: ...
def transform_affine(self, values: ArrayLike) -> np.ndarray: ...
def transform_non_affine(self, points: ArrayLike) -> np.ndarray: ...
def transform_path(self, path: Path) -> Path: ...
def transform_path_affine(self, path: Path) -> Path: ...
def transform_path_non_affine(self, path: Path) -> Path: ...
def get_affine(self): ...
class Affine2DBase(AffineBase):
input_dims = ...
output_dims = ...
def frozen(self): ...
@property
def is_separable(self) -> bool: ...
def to_values(self) -> tuple[float, float, float, float, float, float]: ...
def transform_affine(self, points: ArrayLike) -> np.ndarray: ...
def inverted(self) -> Transform: ...
class Affine2D(Affine2DBase):
def __init__(self, matrix: ArrayLike = ..., **kwargs) -> None: ...
@staticmethod
def from_values(a: float, b: float, c: float, d: float, e: float, f: float): ...
def get_matrix(self) -> np.ndarray: ...
def set_matrix(self, mtx: np.ndarray): ...
def set(self, other: Transform): ...
@staticmethod
def identity() -> Affine2D: ...
def clear(self) -> None: ...
def rotate(self, theta: float) -> Affine2D: ...
def rotate_deg(self, degrees: float) -> Affine2D: ...
def rotate_around(self, x: float, y: float, theta: float) -> Affine2D: ...
def rotate_deg_around(self, x: float, y: float, degrees: float) -> Affine2D: ...
def translate(self, tx: float, ty: float) -> Affine2D: ...
def scale(self, sx: float, sy: float = ...) -> Affine2D: ...
def skew(self, xShear: float, yShear: float) -> Affine2D: ...
def skew_deg(self, xShear: float, yShear: float) -> Affine2D: ...
class IdentityTransform(Affine2DBase):
_mtx = np.identity(3)
def frozen(self): ...
def get_matrix(self): ...
def transform(self, points: ArrayLike) -> np.ndarray: ...
def transform_affine(self, points: ArrayLike) -> np.ndarray: ...
def transform_non_affine(self, points: ArrayLike) -> np.ndarray: ...
def transform_path(self, path: Path) -> Path: ...
def transform_path_affine(self, path: Path) -> Path: ...
def transform_path_non_affine(self, path: Path) -> Path: ...
def get_affine(self): ...
def inverted(self) -> Transform: ...
class _BlendedMixin:
def __eq__(self, other) -> bool: ...
def contains_branch_seperately(self, transform: Transform) -> bool: ...
class BlendedGenericTransform(_BlendedMixin, Transform):
input_dims = ...
output_dims = ...
is_separable = ...
pass_through = ...
def __init__(self, x_transform: Transform, y_transform: Transform, **kwargs) -> None: ...
@property
def depth(self): ...
def contains_branch(self, other: Transform) -> bool: ...
is_affine = ...
has_inverse = ...
def frozen(self): ...
def transform_non_affine(self, points: ArrayLike) -> np.ndarray: ...
def inverted(self) -> Transform: ...
def get_affine(self): ...
class BlendedAffine2D(_BlendedMixin, Affine2DBase):
is_separable = ...
def __init__(self, x_transform: Transform, y_transform: Transform, **kwargs) -> None: ...
def get_matrix(self): ...
def blended_transform_factory(x_transform: Transform, y_transform: Transform) -> Transform: ...
class CompositeGenericTransform(Transform):
pass_through = ...
def __init__(self, a: Transform, b: Transform, **kwargs) -> None: ...
def frozen(self): ...
def __eq__(self, other) -> bool: ...
depth = ...
is_affine = ...
is_separable = ...
has_inverse = ...
def transform_affine(self, points: ArrayLike) -> np.ndarray: ...
def transform_non_affine(self, points: ArrayLike) -> np.ndarray: ...
def transform_path_non_affine(self, path: Path) -> Path: ...
def get_affine(self): ...
def inverted(self) -> Transform: ...
class CompositeAffine2D(Affine2DBase):
def __init__(self, a: Transform, b: Transform, **kwargs) -> None: ...
@property
def depth(self): ...
def get_matrix(self): ...
def composite_transform_factory(a: Transform, b: Transform) -> Transform: ...
class BboxTransform(Affine2DBase):
is_separable = ...
def __init__(self, boxin, boxout, **kwargs) -> None: ...
def get_matrix(self): ...
class BboxTransformTo(Affine2DBase):
is_separable = ...
def __init__(self, boxout, **kwargs) -> None: ...
def get_matrix(self): ...
class BboxTransformToMaxOnly(BboxTransformTo):
def get_matrix(self): ...
class BboxTransformFrom(Affine2DBase):
is_separable = ...
def __init__(self, boxin, **kwargs) -> None: ...
def get_matrix(self): ...
class ScaledTranslation(Affine2DBase):
def __init__(self, xt: float, yt: float, scale_trans, **kwargs) -> None: ...
def get_matrix(self): ...
class AffineDeltaTransform(Affine2DBase):
def __init__(self, transform: Transform, **kwargs) -> None: ...
def get_matrix(self): ...
class TransformedPath(TransformNode):
def __init__(self, path, transform: Transform) -> None: ...
def get_transformed_points_and_affine(self) -> Path: ...
def get_transformed_path_and_affine(self) -> Path: ...
def get_fully_transformed_path(self) -> Path: ...
def get_affine(self): ...
class TransformedPatchPath(TransformedPath):
def __init__(self, patch: Patch) -> None: ...
def nonsingular(
vmin: float,
vmax: float,
expander: float = ...,
tiny: float = ...,
increasing: bool = ...,
): ...
def interval_contains(interval: Sequence[float], val: float) -> bool: ...
def interval_contains_open(interval: Sequence[float], val: float) -> bool: ...
def offset_copy(
trans: Transform,
fig: Figure | None = None,
x: float = 0,
y: float = 0,
units: Literal["inches", "points", "dots"] = "inches",
) -> Transform: ...