Skip to content

Commit d63e299

Browse files
committed
ran black ., some formatting
1 parent 0ca7e74 commit d63e299

File tree

7 files changed

+22
-7
lines changed

7 files changed

+22
-7
lines changed

python/python/async_tiff/_decoder.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from .enums import CompressionMethod
55

66
class Decoder(Protocol):
77
"""A custom Python-provided decompression algorithm."""
8+
89
# In the future, we could pass in photometric interpretation and jpeg tables as
910
# well.
1011
@staticmethod
@@ -13,6 +14,7 @@ class Decoder(Protocol):
1314

1415
class DecoderRegistry:
1516
"""A registry holding multiple decoder methods."""
17+
1618
def __init__(
1719
self, custom_decoders: dict[CompressionMethod | int, Decoder] | None = None
1820
) -> None:

python/python/async_tiff/_ifd.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from .enums import (
2+
Endianness,
23
CompressionMethod,
34
PhotometricInterpretation,
45
PlanarConfiguration,
@@ -11,6 +12,8 @@ from ._geo import GeoKeyDirectory
1112
Value = int | float | str | tuple[int, int] | list[Value]
1213

1314
class ImageFileDirectory:
15+
@property
16+
def endianness(self) -> Endianness: ...
1417
@property
1518
def new_subfile_type(self) -> int | None: ...
1619
@property
@@ -30,6 +33,7 @@ class ImageFileDirectory:
3033
An `int` will be returned if the compression is not one of the values in
3134
`CompressionMethod`.
3235
"""
36+
3337
@property
3438
def photometric_interpretation(self) -> PhotometricInterpretation: ...
3539
@property
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
class ThreadPool:
22
"""A Rust-managed thread pool."""
3+
34
def __init__(self, num_threads: int) -> None:
45
"""Construct a new ThreadPool with the given number of threads."""

python/python/async_tiff/_tiff.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ class TIFF:
2828
Returns:
2929
A TIFF instance.
3030
"""
31+
3132
@property
3233
def ifds(self) -> list[ImageFileDirectory]:
3334
"""Access the underlying IFDs of this TIFF.
3435
3536
Each ImageFileDirectory (IFD) represents one of the internal "sub images" of
3637
this file.
3738
"""
39+
3840
async def fetch_tile(self, x: int, y: int, z: int) -> Tile:
3941
"""Fetch a single tile.
4042
@@ -46,6 +48,7 @@ class TIFF:
4648
Returns:
4749
Tile response.
4850
"""
51+
4952
async def fetch_tiles(self, x: list[int], y: list[int], z: int) -> list[Tile]:
5053
"""Fetch multiple tiles concurrently.
5154

python/python/async_tiff/_tile.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,23 @@ from ._thread_pool import ThreadPool
66

77
class Tile:
88
"""A representation of a TIFF image tile."""
9+
910
@property
1011
def x(self) -> int:
1112
"""The column index this tile represents."""
13+
1214
@property
1315
def y(self) -> int:
1416
"""The row index this tile represents."""
17+
1518
@property
1619
def compressed_bytes(self) -> Buffer:
1720
"""The compressed bytes underlying this tile."""
21+
1822
@property
1923
def compression_method(self) -> CompressionMethod | int:
2024
"""The compression method used by this tile."""
25+
2126
async def decode_async(
2227
self,
2328
*,

python/python/async_tiff/enums.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@
55
from enum import StrEnum
66
else:
77
from enum import Enum
8+
89
class StrEnum(str, Enum):
910
def __str__(self):
1011
return str(self.value)
1112

13+
1214
class Endianness(StrEnum):
1315
"""
1416
endianness of the underlying tiff file
1517
"""
1618

1719
LittleEndian = "LittleEndian"
1820
BigEndian = "BigEndian"
19-
21+
2022

2123
class CompressionMethod(IntEnum):
2224
"""

python/src/enums.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
use async_tiff::{
2-
reader::Endianness,
3-
tiff::tags::{
4-
CompressionMethod, PhotometricInterpretation, PlanarConfiguration, Predictor,
5-
ResolutionUnit, SampleFormat,
6-
},
1+
use async_tiff::reader::Endianness;
2+
use async_tiff::tiff::tags::{
3+
CompressionMethod, PhotometricInterpretation, PlanarConfiguration, Predictor, ResolutionUnit,
4+
SampleFormat,
75
};
86
use pyo3::prelude::*;
97
use pyo3::types::{PyString, PyTuple};

0 commit comments

Comments
 (0)