async-tiff 0.4.0__cp310-cp310-win_amd64.whl → 0.4.0b1__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
async_tiff/__init__.py CHANGED
@@ -1,32 +1,9 @@
1
1
  from typing import TYPE_CHECKING
2
2
 
3
- from ._async_tiff import (
4
- TIFF,
5
- Array,
6
- DecoderRegistry,
7
- GeoKeyDirectory,
8
- ImageFileDirectory,
9
- ThreadPool,
10
- Tile,
11
- ___version, # noqa: F403 # pyright:ignore[reportAttributeAccessIssue]
12
- )
13
- from ._decoder_runtime import Decoder
14
- from ._input import ObspecInput
3
+ from ._async_tiff import *
4
+ from ._async_tiff import ___version
15
5
 
16
6
  if TYPE_CHECKING:
17
7
  from . import store
18
8
 
19
9
  __version__: str = ___version()
20
-
21
- __all__ = [
22
- "store",
23
- "Array",
24
- "Decoder",
25
- "DecoderRegistry",
26
- "GeoKeyDirectory",
27
- "ImageFileDirectory",
28
- "ThreadPool",
29
- "TIFF",
30
- "ObspecInput",
31
- "Tile",
32
- ]
async_tiff/_array.pyi CHANGED
@@ -23,10 +23,9 @@ class Array(Buffer):
23
23
  ```
24
24
  """
25
25
 
26
- # This is intended only for tests
27
- # def __init__(
28
- # self, data: Buffer, shape: tuple[int, int, int], format: str
29
- # ) -> None: ...
26
+ def __init__(
27
+ self, data: Buffer, shape: tuple[int, int, int], format: str
28
+ ) -> None: ...
30
29
  def __buffer__(self, flags: int) -> memoryview[int]: ...
31
30
  @property
32
31
  def shape(self) -> tuple[int, int, int]:
Binary file
@@ -1,17 +1,9 @@
1
- from ._array import Array
2
- from ._decoder import DecoderRegistry
3
- from ._geo import GeoKeyDirectory
4
- from ._ifd import ImageFileDirectory
5
- from ._thread_pool import ThreadPool
6
- from ._tiff import TIFF
7
- from ._tile import Tile
8
-
9
- __all__ = [
10
- "Array",
11
- "DecoderRegistry",
12
- "GeoKeyDirectory",
13
- "ImageFileDirectory",
14
- "ThreadPool",
15
- "TIFF",
16
- "Tile",
17
- ]
1
+ from ._array import Array as Array
2
+ from ._decoder import Decoder as Decoder
3
+ from ._decoder import DecoderRegistry as DecoderRegistry
4
+ from ._geo import GeoKeyDirectory as GeoKeyDirectory
5
+ from ._ifd import ImageFileDirectory as ImageFileDirectory
6
+ from ._thread_pool import ThreadPool as ThreadPool
7
+ from ._tiff import TIFF as TIFF
8
+ from ._tiff import ObspecInput as ObspecInput
9
+ from ._tile import Tile as Tile
async_tiff/_decoder.pyi CHANGED
@@ -1,6 +1,16 @@
1
- from ._decoder_runtime import Decoder
1
+ from typing import Protocol
2
+ from collections.abc import Buffer
3
+
2
4
  from .enums import CompressionMethod
3
5
 
6
+ class Decoder(Protocol):
7
+ """A custom Python-provided decompression algorithm."""
8
+ # In the future, we could pass in photometric interpretation and jpeg tables as
9
+ # well.
10
+ @staticmethod
11
+ def __call__(buffer: Buffer) -> Buffer:
12
+ """A callback to decode compressed data."""
13
+
4
14
  class DecoderRegistry:
5
15
  """A registry holding multiple decoder methods."""
6
16
  def __init__(
async_tiff/_ifd.pyi CHANGED
@@ -1,7 +1,5 @@
1
1
  from collections.abc import Iterable
2
2
  from typing import Any
3
-
4
- from ._geo import GeoKeyDirectory
5
3
  from .enums import (
6
4
  CompressionMethod,
7
5
  PhotometricInterpretation,
@@ -10,6 +8,7 @@ from .enums import (
10
8
  ResolutionUnit,
11
9
  SampleFormat,
12
10
  )
11
+ from ._geo import GeoKeyDirectory
13
12
 
14
13
  Value = int | float | str | tuple[int, int] | list[Value]
15
14
 
@@ -115,8 +114,6 @@ class ImageFileDirectory:
115
114
  @property
116
115
  def model_tiepoint(self) -> list[float] | None: ...
117
116
  @property
118
- def model_transformation(self) -> list[float] | None: ...
119
- @property
120
117
  def gdal_nodata(self) -> str | None: ...
121
118
  @property
122
119
  def gdal_metadata(self) -> str | None: ...
async_tiff/_tiff.pyi CHANGED
@@ -1,9 +1,16 @@
1
+ from typing import Protocol
2
+
3
+ # Fix exports
4
+ from obspec._get import GetRangeAsync, GetRangesAsync
5
+
1
6
  from ._ifd import ImageFileDirectory
2
- from ._input import ObspecInput
3
7
  from ._tile import Tile
4
8
  from .enums import Endianness
5
9
  from .store import ObjectStore
6
10
 
11
+ class ObspecInput(GetRangeAsync, GetRangesAsync, Protocol):
12
+ """Supported obspec input to reader."""
13
+
7
14
  class TIFF:
8
15
  @classmethod
9
16
  async def open(
async_tiff/_tile.pyi CHANGED
@@ -1,9 +1,9 @@
1
1
  from collections.abc import Buffer
2
2
 
3
3
  from ._array import Array
4
+ from .enums import CompressionMethod
4
5
  from ._decoder import DecoderRegistry
5
6
  from ._thread_pool import ThreadPool
6
- from .enums import CompressionMethod
7
7
 
8
8
  class Tile:
9
9
  """A representation of a TIFF image tile."""
@@ -19,25 +19,7 @@ class Tile:
19
19
  @property
20
20
  def compression_method(self) -> CompressionMethod | int:
21
21
  """The compression method used by this tile."""
22
- def decode_sync(
23
- self,
24
- *,
25
- decoder_registry: DecoderRegistry | None = None,
26
- ) -> Array:
27
- """Decode this tile's data.
28
-
29
- **Note**: This is a blocking function and will perform the tile decompression on
30
- the current thread. Prefer using the asynchronous `decode` method, which will
31
- offload decompression to a thread pool.
32
-
33
- Keyword Args:
34
- decoder_registry: the decoders to use for decompression. Defaults to None, in which case a default decoder registry is used.
35
-
36
- Returns:
37
- Decoded tile data as an Array instance.
38
- """
39
-
40
- async def decode(
22
+ async def decode_async(
41
23
  self,
42
24
  *,
43
25
  decoder_registry: DecoderRegistry | None = None,
@@ -45,13 +27,9 @@ class Tile:
45
27
  ) -> Array:
46
28
  """Decode this tile's data.
47
29
 
48
- This is an asynchronous function that will offload the tile decompression to a
49
- thread pool.
50
-
51
30
  Keyword Args:
52
- decoder_registry: the decoders to use for decompression. Defaults to None, in which case a default decoder registry is used.
53
- pool: the thread pool on which to run decompression. Defaults to None, in
54
- which case, a default thread pool is used.
31
+ decoder_registry: the decoders to use for decompression. Defaults to None.
32
+ pool: the thread pool on which to run decompression. Defaults to None.
55
33
 
56
34
  Returns:
57
35
  Decoded tile data as an Array instance.
async_tiff/enums.py CHANGED
@@ -57,5 +57,5 @@ class ResolutionUnit(IntEnum):
57
57
  class SampleFormat(IntEnum):
58
58
  Uint = 1
59
59
  Int = 2
60
- Float = 3
60
+ IEEEFP = 3
61
61
  Void = 4
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: async-tiff
3
- Version: 0.4.0
3
+ Version: 0.4.0b1
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
7
- Requires-Dist: obspec>=0.1.0
7
+ Requires-Dist: obspec>=0.1.0b3
8
8
  Requires-Python: >=3.10
@@ -0,0 +1,15 @@
1
+ async_tiff\__init__.py,sha256=hfG4M-ebgb-3JYmkoqk8IftZ1Etu_PwyyizCPZPbw9Y,182
2
+ async_tiff\_array.pyi,sha256=-NBlApERjVRjR0_393xeGolLJsy3JJfZLoq8ORixSnM,1157
3
+ async_tiff\_async_tiff.cp310-win_amd64.pyd,sha256=e_RzNt0XOL8LeeWWyC82W-I42sq0vYbd7UHd1uehycg,8723456
4
+ async_tiff\_async_tiff.pyi,sha256=5aJxlpnSMf287Mk7l7VRq7cVLRf4rZQtZPVisbV9Xlw,415
5
+ async_tiff\_decoder.pyi,sha256=LiK_iwhaT4ydR8yGYCwI855OSJSBvgsHUMrT7Chlsko,1072
6
+ async_tiff\_geo.pyi,sha256=Hu39c7XYkvUi09XHRHFUiYKGfEYp-VMijaOiu64x83c,3553
7
+ async_tiff\_ifd.pyi,sha256=0LLCta6UyasdJJV-dkQgDPtEulay3T4BMVlkTAM8nTA,4025
8
+ async_tiff\_thread_pool.pyi,sha256=7jJy_rc3DMxH7jGTeDLbfyunrRH0TeF44owGmb3Rnu4,185
9
+ async_tiff\_tiff.pyi,sha256=NEw49KQHwSa8PSnK54UZFKjw3OjyipLS1bGLGI3qehQ,2221
10
+ async_tiff\_tile.pyi,sha256=vXPkAnHOcD8CaUpTLvgOofL-vu5hZvNx2SIMfrNQCbs,1172
11
+ async_tiff\enums.py,sha256=3Js1T6sTMlr2ZUZZQ6KV3Fm2ZcfVfbsDVUOx5624jfs,1044
12
+ async_tiff\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ async_tiff-0.4.0b1.dist-info\METADATA,sha256=fRD7hNm-CbFYgZzFVg4FrgzkTjdpmBrGq1KRqn-qum4,293
14
+ async_tiff-0.4.0b1.dist-info\WHEEL,sha256=L_nHnx2hhpjVM_Xfu45p0kXGA_F4gVVL8EpDS6M9jpM,97
15
+ async_tiff-0.4.0b1.dist-info\RECORD,,
@@ -1,21 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import sys
4
- from typing import TYPE_CHECKING, Protocol
5
-
6
- if TYPE_CHECKING:
7
- if sys.version_info >= (3, 12):
8
- from collections.abc import Buffer
9
- else:
10
- from typing_extensions import Buffer
11
-
12
-
13
- class Decoder(Protocol):
14
- """A custom Python-provided decompression algorithm."""
15
-
16
- # In the future, we could pass in photometric interpretation and jpeg tables as
17
- # well.
18
- @staticmethod
19
- def __call__(buffer: Buffer) -> Buffer:
20
- """A callback to decode compressed data."""
21
- ...
async_tiff/_input.py DELETED
@@ -1,8 +0,0 @@
1
- from typing import Protocol
2
-
3
- # Fix exports
4
- from obspec._get import GetRangeAsync, GetRangesAsync
5
-
6
-
7
- class ObspecInput(GetRangeAsync, GetRangesAsync, Protocol):
8
- """Supported obspec input to reader."""
@@ -1,17 +0,0 @@
1
- async_tiff\__init__.py,sha256=tghcCDvHn12yesTLmIRNrZbyDTnv2obtlMVIQ8mRlsY,618
2
- async_tiff\_array.pyi,sha256=QhM0X4HFKVUcnuEEbf0kYRx_mqdPY5FCxcMVmKhiNio,1202
3
- async_tiff\_async_tiff.cp310-win_amd64.pyd,sha256=-aMK2h7M1qHmS4FPrr-RwIE0MTFbGQD_TKMGXraoM-c,8735232
4
- async_tiff\_async_tiff.pyi,sha256=HPQ1X7lKvnN8CCJPh8vwC0xlJBgAffixuTmflrBUb8M,379
5
- async_tiff\_decoder.pyi,sha256=5RhP6VNsS3VN7a9mYWbx43JEqayVG-FRvIrzRhVa2G0,740
6
- async_tiff\_decoder_runtime.py,sha256=cRQriBKKz9Fl4U9FT790fvK9iXsuyEGTsmrIyDbc0pg,574
7
- async_tiff\_geo.pyi,sha256=Hu39c7XYkvUi09XHRHFUiYKGfEYp-VMijaOiu64x83c,3553
8
- async_tiff\_ifd.pyi,sha256=k1__RKUg-Tr0nXFTIN9YkrYww4iZGlyPijfiB_AO86g,4105
9
- async_tiff\_input.py,sha256=2GPHTBzObUVV_CxWrCN0YgP194MzYfdS5Cjz3gh_WeY,211
10
- async_tiff\_thread_pool.pyi,sha256=7jJy_rc3DMxH7jGTeDLbfyunrRH0TeF44owGmb3Rnu4,185
11
- async_tiff\_tiff.pyi,sha256=gsZQvJDdmJiiSBdY_4D3E67CJOQ9SJuDYuOI-tdcd80,2043
12
- async_tiff\_tile.pyi,sha256=DDr9Wf6JY6D10GuHWsCs30dy80nSeT0z8FKI19ZgLCE,2031
13
- async_tiff\enums.py,sha256=kcc6lA4AZDBPebSQ4C9kCkiVEero3sKkTOftYCY4fpE,1043
14
- async_tiff\py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- async_tiff-0.4.0.dist-info\METADATA,sha256=2Hkh524tDGJ0nOYlHcFnyMcMgKvSQFoS9C-39cl-Ma0,289
16
- async_tiff-0.4.0.dist-info\WHEEL,sha256=L_nHnx2hhpjVM_Xfu45p0kXGA_F4gVVL8EpDS6M9jpM,97
17
- async_tiff-0.4.0.dist-info\RECORD,,