Skip to content

Commit

Permalink
Apply black=24+ to code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill888 committed Mar 1, 2024
1 parent 6af5d0c commit 26a79d1
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 41 deletions.
1 change: 1 addition & 0 deletions odc/geo/_interop.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Check if libraries available without importing them which can be slow.
"""

import importlib.util
from typing import Any, Callable, Optional

Expand Down
1 change: 1 addition & 0 deletions odc/geo/_rgba.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Helpers for dealing with RGB(A) images.
"""

import functools
from typing import Any, List, Optional, Tuple

Expand Down
19 changes: 7 additions & 12 deletions odc/geo/cog/_mpu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Multi-part upload as a graph
"""

from __future__ import annotations

from functools import partial
Expand Down Expand Up @@ -34,27 +35,21 @@
class PartsWriter(Protocol):
"""Protocol for labeled parts data writer."""

def __call__(self, part: int, data: SomeData) -> Dict[str, Any]:
...
def __call__(self, part: int, data: SomeData) -> Dict[str, Any]: ...

def finalise(self, parts: List[Dict[str, Any]]) -> Any:
...
def finalise(self, parts: List[Dict[str, Any]]) -> Any: ...

@property
def min_write_sz(self) -> int:
...
def min_write_sz(self) -> int: ...

@property
def max_write_sz(self) -> int:
...
def max_write_sz(self) -> int: ...

@property
def min_part(self) -> int:
...
def min_part(self) -> int: ...

@property
def max_part(self) -> int:
...
def max_part(self) -> int: ...


class MPUChunk:
Expand Down
1 change: 1 addition & 0 deletions odc/geo/cog/_mpu_fs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
MPU file sink
"""

from __future__ import annotations

import mmap
Expand Down
1 change: 1 addition & 0 deletions odc/geo/cog/_s3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
S3 utils for COG to S3.
"""

from __future__ import annotations

from threading import Lock
Expand Down
6 changes: 3 additions & 3 deletions odc/geo/cog/_tifffile.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,9 @@ def save_cog_with_dask(
**upload_params,
)

upload_params[
"ContentType"
] = "image/tiff;application=geotiff;profile=cloud-optimized"
upload_params["ContentType"] = (
"image/tiff;application=geotiff;profile=cloud-optimized"
)

cleanup = aws.pop("cleanup", False)
s3_sink = MultiPartUpload(bucket, key, **aws)
Expand Down
3 changes: 1 addition & 2 deletions odc/geo/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
class CRSLike(Protocol):
"""CRS Like object."""

def to_wkt(self, *args, **kw) -> str:
...
def to_wkt(self, *args, **kw) -> str: ...


_crs_cache: Dict[Hashable, Tuple[_CRS, str, Optional[int]]] = {}
Expand Down
9 changes: 3 additions & 6 deletions odc/geo/overlap.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ class PointTransform(Protocol):
Invertible point transform.
"""

def __call__(self, pts: Sequence[XY[float]]) -> Sequence[XY[float]]:
...
def __call__(self, pts: Sequence[XY[float]]) -> Sequence[XY[float]]: ...

@property
def back(self) -> "PointTransform":
...
def back(self) -> "PointTransform": ...

@property
def linear(self) -> Optional[Affine]:
...
def linear(self) -> Optional[Affine]: ...


class LinearPointTransform:
Expand Down
24 changes: 8 additions & 16 deletions odc/geo/roi.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,24 @@ class RoiTiles(Protocol):
Abstraction for 2d slice/shape/chunks lookup.
"""

def __getitem__(self, idx: Union[SomeIndex2d, ROI]) -> Tuple[slice, slice]:
...
def __getitem__(self, idx: Union[SomeIndex2d, ROI]) -> Tuple[slice, slice]: ...

def crop(self, roi: ROI) -> "RoiTiles":
...
def crop(self, roi: ROI) -> "RoiTiles": ...

def tile_shape(self, idx: SomeIndex2d) -> Shape2d:
...
def tile_shape(self, idx: SomeIndex2d) -> Shape2d: ...

@property
def shape(self) -> Shape2d:
...
def shape(self) -> Shape2d: ...

@property
def base(self) -> Shape2d:
...
def base(self) -> Shape2d: ...

@property
def chunks(self) -> Chunks2d:
...
def chunks(self) -> Chunks2d: ...

def locate(self, pix: SomeIndex2d) -> Tuple[int, int]:
...
def locate(self, pix: SomeIndex2d) -> Tuple[int, int]: ...

def __dask_tokenize__(self):
...
def __dask_tokenize__(self): ...


def norm_slice_2d(
Expand Down
4 changes: 2 additions & 2 deletions odc/geo/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic types."""

from enum import Enum
from typing import (
Callable,
Expand Down Expand Up @@ -240,8 +241,7 @@ class SupportsCoords(Protocol[T]):
"""

@property
def coords(self) -> List[Tuple[T, T]]:
...
def coords(self) -> List[Tuple[T, T]]: ...


# fmt: off
Expand Down

0 comments on commit 26a79d1

Please sign in to comment.