Skip to content

Commit 642d58b

Browse files
committed
Unused imports
1 parent ba31840 commit 642d58b

13 files changed

+113
-93
lines changed

stubs/D3DShot/d3dshot/capture_output.pyi

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import enum
22
from _typeshed import Incomplete
3-
from typing import Any
43
from typing_extensions import TypeAlias
54

65
from PIL.Image import Image
76

8-
Frame: TypeAlias = Any
9-
# Frame: TypeAlias = Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | torch.Tensor
10-
Pointer: TypeAlias = Incomplete
7+
_Frame: TypeAlias = Incomplete
8+
# _Frame: TypeAlias = Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | _Tensor
9+
_Pointer: TypeAlias = Incomplete
1110

1211
class CaptureOutputs(enum.Enum):
1312
PIL: int
@@ -24,7 +23,7 @@ class CaptureOutput:
2423
backend: CaptureOutput
2524
def __init__(self, backend: CaptureOutputs = ...) -> None: ...
2625
def process(
27-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
28-
) -> Frame: ...
29-
def to_pil(self, frame: Frame) -> Image: ...
30-
def stack(self, frames: list[Frame], stack_dimension) -> Frame: ...
26+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
27+
) -> _Frame: ...
28+
def to_pil(self, frame: _Frame) -> Image: ...
29+
def stack(self, frames: list[_Frame], stack_dimension) -> _Frame: ...
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
from _typeshed import Incomplete
22
from typing_extensions import TypeAlias
33

4-
import numpy as np
5-
import numpy.typing as npt
64
from d3dshot.capture_output import CaptureOutput as CaptureOutput
75
from PIL.Image import Image
86

9-
Pointer: TypeAlias = Incomplete
10-
NDArray: TypeAlias = npt.NDArray[np.int32]
7+
# TODO: Complete types once we can import non-types dependencies
8+
# See: https://github.com/python/typeshed/issues/5768
9+
# import numpy as np
10+
# import numpy.typing as npt
11+
# NDArray: TypeAlias = npt.NDArray[np.int32]
12+
NDArray: TypeAlias = Incomplete
13+
_Pointer: TypeAlias = Incomplete
1114

1215
class NumpyCaptureOutput(CaptureOutput):
1316
def __init__(self) -> None: ...
1417
def process(
15-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
18+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
1619
) -> NDArray: ...
1720
def to_pil(self, frame: NDArray) -> Image: ...
1821
def stack(self, frames: list[NDArray] | NDArray, stack_dimension: int) -> NDArray: ...
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
from _typeshed import Incomplete
22
from typing_extensions import TypeAlias
33

4-
import numpy as np
5-
import numpy.typing as npt
64
from d3dshot.capture_output import CaptureOutput as CaptureOutput
75
from PIL.Image import Image
86

9-
Pointer: TypeAlias = Incomplete
10-
NDArray: TypeAlias = npt.NDArray[np.float32]
7+
# TODO: Complete types once we can import non-types dependencies
8+
# See: https://github.com/python/typeshed/issues/5768
9+
# import numpy as np
10+
# import numpy.typing as npt
11+
# NDArray: TypeAlias = npt.NDArray[np.float32]
12+
NDArray: TypeAlias = Incomplete
13+
_Pointer: TypeAlias = Incomplete
1114

1215
class NumpyFloatCaptureOutput(CaptureOutput):
1316
def __init__(self) -> None: ...
1417
def process(
15-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
18+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
1619
) -> NDArray: ...
1720
def to_pil(self, frame: NDArray) -> Image: ...
1821
def stack(self, frames: list[NDArray] | NDArray, stack_dimension: int) -> NDArray: ...

stubs/D3DShot/d3dshot/capture_outputs/pil_capture_output.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ from typing_extensions import TypeAlias
44
from d3dshot.capture_output import CaptureOutput as CaptureOutput
55
from PIL.Image import Image
66

7-
Pointer: TypeAlias = Incomplete
7+
_Pointer: TypeAlias = Incomplete
88

99
class PILCaptureOutput(CaptureOutput):
1010
def __init__(self) -> None: ...
1111
def process(
12-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
12+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
1313
) -> Image: ...
1414
def to_pil(self, frame: Image) -> Image: ...
1515
def stack(self, frames: list[Image], stack_dimension: int) -> list[Image]: ...
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
from _typeshed import Incomplete
22
from typing_extensions import TypeAlias
33

4-
import torch
54
from d3dshot.capture_output import CaptureOutput as CaptureOutput
65
from PIL.Image import Image
76

8-
Pointer: TypeAlias = Incomplete
7+
# TODO: Complete types once we can import non-types dependencies
8+
# See: https://github.com/python/typeshed/issues/5768
9+
# from torch import Tensor
10+
_Tensor: TypeAlias = Incomplete
11+
_Pointer: TypeAlias = Incomplete
912

1013
class PytorchCaptureOutput(CaptureOutput):
1114
def __init__(self) -> None: ...
1215
def process(
13-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
14-
) -> torch.Tensor: ...
15-
def to_pil(self, frame: torch.Tensor) -> Image: ...
16-
def stack(self, frames: list[torch.Tensor], stack_dimension: int) -> torch.Tensor: ...
16+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
17+
) -> _Tensor: ...
18+
def to_pil(self, frame: _Tensor) -> Image: ...
19+
def stack(self, frames: list[_Tensor], stack_dimension: int) -> _Tensor: ...
Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
from _typeshed import Incomplete
22
from typing_extensions import TypeAlias
33

4-
import torch
54
from d3dshot.capture_output import CaptureOutput as CaptureOutput
65
from PIL.Image import Image
76

8-
Pointer: TypeAlias = Incomplete
7+
# TODO: Complete types once we can import non-types dependencies
8+
# See: https://github.com/python/typeshed/issues/5768
9+
# from torch import Tensor
10+
_Tensor: TypeAlias = Incomplete
11+
_Pointer: TypeAlias = Incomplete
912

1013
class PytorchFloatCaptureOutput(CaptureOutput):
1114
def __init__(self) -> None: ...
1215
def process(
13-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
14-
) -> torch.Tensor: ...
15-
def to_pil(self, frame: torch.Tensor) -> Image: ...
16-
def stack(self, frames: list[torch.Tensor], stack_dimension: int) -> torch.Tensor: ...
16+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
17+
) -> _Tensor: ...
18+
def to_pil(self, frame: _Tensor) -> Image: ...
19+
def stack(self, frames: list[_Tensor], stack_dimension: int) -> _Tensor: ...
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
from _typeshed import Incomplete
22
from typing_extensions import TypeAlias
33

4-
import torch
54
from d3dshot.capture_output import CaptureOutput as CaptureOutput
65
from PIL.Image import Image
76

8-
Pointer: TypeAlias = Incomplete
7+
# TODO: Complete types once we can import non-types dependencies
8+
# See: https://github.com/python/typeshed/issues/5768
9+
# from torch import device, Tensor
10+
_Tensor: TypeAlias = Incomplete
11+
_device: TypeAlias = Incomplete
12+
_Pointer: TypeAlias = Incomplete
913

1014
class PytorchFloatGPUCaptureOutput(CaptureOutput):
11-
device: Incomplete
15+
device: _device
1216
def __init__(self) -> None: ...
1317
def process(
14-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
15-
) -> torch.Tensor: ...
16-
def to_pil(self, frame: torch.Tensor) -> Image: ...
17-
def stack(self, frames: list[torch.Tensor], stack_dimension: int) -> torch.Tensor: ...
18+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
19+
) -> _Tensor: ...
20+
def to_pil(self, frame: _Tensor) -> Image: ...
21+
def stack(self, frames: list[_Tensor], stack_dimension: int) -> _Tensor: ...
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
from _typeshed import Incomplete
22
from typing_extensions import TypeAlias
33

4-
import torch
54
from d3dshot.capture_output import CaptureOutput as CaptureOutput
65
from PIL.Image import Image
76

8-
Pointer: TypeAlias = Incomplete
7+
# TODO: Complete types once we can import non-types dependencies
8+
# See: https://github.com/python/typeshed/issues/5768
9+
# from torch import device, Tensor
10+
_Tensor: TypeAlias = Incomplete
11+
_device: TypeAlias = Incomplete
12+
13+
_Pointer: TypeAlias = Incomplete
914

1015
class PytorchGPUCaptureOutput(CaptureOutput):
11-
device: torch.device
16+
device: _device
1217
def __init__(self) -> None: ...
1318
def process(
14-
self, pointer: Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
15-
) -> torch.Tensor: ...
16-
def to_pil(self, frame: torch.Tensor) -> Image: ...
17-
def stack(self, frames: list[torch.Tensor], stack_dimension: int): ...
19+
self, pointer: _Pointer, size: int, width: int, height: int, region: tuple[int, int, int, int], rotation: int
20+
) -> _Tensor: ...
21+
def to_pil(self, frame: _Tensor) -> Image: ...
22+
def stack(self, frames: list[_Tensor], stack_dimension: int): ...

stubs/D3DShot/d3dshot/d3dshot.pyi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1+
from _typeshed import Incomplete
12
from collections import deque
2-
from typing import Any
33
from typing_extensions import TypeAlias
44

55
from d3dshot.capture_output import CaptureOutput as CaptureOutput, CaptureOutputs as CaptureOutputs
66
from d3dshot.display import Display as Display
77

8-
Frame: TypeAlias = Any
9-
# Frame: TypeAlias = Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | torch.Tensor
8+
_Frame: TypeAlias = Incomplete
9+
# _Frame: TypeAlias = Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | _Tensor
1010

1111
class D3DShot:
1212
displays: list[Display]
1313
display: Display
1414
capture_output: CaptureOutput
1515
frame_buffer_size: int
16-
frame_buffer: deque[Frame]
17-
previous_screenshot: Frame | None
16+
frame_buffer: deque[_Frame]
17+
previous_screenshot: _Frame | None
1818
region: tuple[int, int, int, int] | None
1919

2020
def __init__(
@@ -28,11 +28,11 @@ class D3DShot:
2828
) -> None: ...
2929
@property
3030
def is_capturing(self) -> bool: ...
31-
def get_latest_frame(self) -> Frame | None: ...
32-
def get_frame(self, frame_index: int) -> Frame | None: ...
33-
def get_frames(self, frame_indices: list[int]) -> list[Frame]: ...
34-
def get_frame_stack(self, frame_indices: list[int], stack_dimension: str | None = ...) -> Frame: ...
35-
def screenshot(self, region: tuple[int, int, int, int] | None = ...) -> Frame | None: ...
31+
def get_latest_frame(self) -> _Frame | None: ...
32+
def get_frame(self, frame_index: int) -> _Frame | None: ...
33+
def get_frames(self, frame_indices: list[int]) -> list[_Frame]: ...
34+
def get_frame_stack(self, frame_indices: list[int], stack_dimension: str | None = ...) -> _Frame: ...
35+
def screenshot(self, region: tuple[int, int, int, int] | None = ...) -> _Frame | None: ...
3636
def screenshot_to_disk(
3737
self, directory: str | None = ..., file_name: str | None = ..., region: tuple[int, int, int, int] | None = ...
3838
) -> str: ...

stubs/D3DShot/d3dshot/display.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from _typeshed import Incomplete
22
from collections.abc import Callable
3-
from typing import Any, Literal
3+
from typing import Literal
44
from typing_extensions import TypeAlias
55

6-
Frame: TypeAlias = Any
7-
# Frame: TypeAlias = Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | torch.Tensor
8-
Pointer: TypeAlias = Incomplete
6+
_Frame: TypeAlias = Incomplete
7+
# _Frame: TypeAlias = Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | _Tensor
8+
_Pointer: TypeAlias = Incomplete
99

1010
class Display:
1111
name: str
@@ -38,8 +38,8 @@ class Display:
3838
def capture(
3939
self,
4040
# Incomplete: dxgi_mapped_rect.pBits
41-
process_func: Callable[[Pointer, int, int, int, tuple[int, int, int, int], int], Frame | None] | None,
41+
process_func: Callable[[_Pointer, int, int, int, tuple[int, int, int, int], int], _Frame | None] | None,
4242
region: tuple[int, int, int, int] = ...,
43-
) -> Frame: ...
43+
) -> _Frame: ...
4444
@classmethod
4545
def discover_displays(cls) -> list[Display]: ...

0 commit comments

Comments
 (0)