From 59ddd790fc089cd755cca8d29df7128e9d4e8c18 Mon Sep 17 00:00:00 2001 From: Keenan Eves Date: Wed, 8 Jan 2025 20:28:09 +0000 Subject: [PATCH] ruff format --- torchgeo/datasets/oscd.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/torchgeo/datasets/oscd.py b/torchgeo/datasets/oscd.py index 8978f4e4cd..27359dc461 100644 --- a/torchgeo/datasets/oscd.py +++ b/torchgeo/datasets/oscd.py @@ -103,8 +103,7 @@ def __init__( root: Path = 'data', split: str = 'train', bands: Sequence[str] = all_bands, - transforms: Callable[[dict[str, Tensor]], - dict[str, Tensor]] | None = None, + transforms: Callable[[dict[str, Tensor]], dict[str, Tensor]] | None = None, download: bool = False, checksum: bool = False, ) -> None: @@ -185,8 +184,7 @@ def _load_files(self) -> list[dict[str, str | Sequence[str]]]: def get_image_paths(ind: int) -> list[str]: return sorted( glob.glob( - os.path.join(images_root, region, - f'imgs_{ind}_rect', '*.tif') + os.path.join(images_root, region, f'imgs_{ind}_rect', '*.tif') ), key=sort_sentinel2_bands, ) @@ -225,8 +223,7 @@ def _load_image(self, paths: Sequence[Path]) -> Tensor: for path in paths: with Image.open(path) as img: images.append(np.array(img)) - array: np.typing.NDArray[np.int_] = np.stack( - images, axis=0).astype(np.int_) + array: np.typing.NDArray[np.int_] = np.stack(images, axis=0).astype(np.int_) tensor = torch.from_numpy(array).float() return tensor