From 144b93f7d4f5dc9a6e3dd13736b4ec470217faee Mon Sep 17 00:00:00 2001 From: Darius Couchard Date: Wed, 17 Apr 2024 13:47:16 +0200 Subject: [PATCH] Fix linting --- src/openeo_gfmap/fetching/commons.py | 9 +++++++-- src/openeo_gfmap/fetching/generic.py | 1 - src/openeo_gfmap/fetching/s2.py | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/openeo_gfmap/fetching/commons.py b/src/openeo_gfmap/fetching/commons.py index 135b441..9855902 100644 --- a/src/openeo_gfmap/fetching/commons.py +++ b/src/openeo_gfmap/fetching/commons.py @@ -37,7 +37,10 @@ def convert_band_names(desired_bands: list, band_dict: dict) -> list: def resample_reproject( - datacube: openeo.DataCube, resolution: float, epsg_code: Optional[Union[str, int]] = None, method: str = 'near' + datacube: openeo.DataCube, + resolution: float, + epsg_code: Optional[Union[str, int]] = None, + method: str = "near", ) -> openeo.DataCube: """Reprojects the given datacube to the target epsg code, if the provided epsg code is not None. Also performs checks on the give code to check @@ -51,7 +54,9 @@ def resample_reproject( raise ValueError( f"Specified target_crs: {epsg_code} is not a valid " "EPSG code." ) from exc - return datacube.resample_spatial(resolution=resolution, projection=epsg_code, method=method) + return datacube.resample_spatial( + resolution=resolution, projection=epsg_code, method=method + ) return datacube.resample_spatial(resolution=resolution, method=method) diff --git a/src/openeo_gfmap/fetching/generic.py b/src/openeo_gfmap/fetching/generic.py index 9251466..fa7398c 100644 --- a/src/openeo_gfmap/fetching/generic.py +++ b/src/openeo_gfmap/fetching/generic.py @@ -94,7 +94,6 @@ def generic_default_processor(cube: openeo.DataCube, **params): method=params.get("resampling_method", "near"), ) - if collection_name == "COPERNICUS_30": cube = cube.min_time() diff --git a/src/openeo_gfmap/fetching/s2.py b/src/openeo_gfmap/fetching/s2.py index 12d0351..680fae2 100644 --- a/src/openeo_gfmap/fetching/s2.py +++ b/src/openeo_gfmap/fetching/s2.py @@ -169,7 +169,7 @@ def s2_l2a_default_processor(cube: openeo.DataCube, **params): cube, params.get("target_resolution", 10.0), params.get("target_crs", None), - method=params.get("resampling_method", "near") + method=params.get("resampling_method", "near"), ) elif params.get("target_crs") is not None: raise ValueError(