diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5733b3b8..9616c78e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -20,7 +20,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.6 + rev: v0.9.4 hooks: # Run the linter. - id: ruff diff --git a/ci/scripts_utils.py b/ci/scripts_utils.py index baccb1af..3770cab3 100644 --- a/ci/scripts_utils.py +++ b/ci/scripts_utils.py @@ -224,9 +224,9 @@ def compare(to_be_checked, ref, topic): Compare two fields """ try: - assert ( - ref == to_be_checked - ), f"Non equal {topic}: ref ={ref} != to_be_checked={to_be_checked}" + assert ref == to_be_checked, ( + f"Non equal {topic}: ref ={ref} != to_be_checked={to_be_checked}" + ) except AssertionError: assert str(to_be_checked).startswith("No") and str(to_be_checked).endswith( "available" diff --git a/eoreader/products/__init__.py b/eoreader/products/__init__.py index 753b690f..92a6a6da 100644 --- a/eoreader/products/__init__.py +++ b/eoreader/products/__init__.py @@ -212,14 +212,14 @@ "SaocomProduct", "SaocomProductType", "SaocomPolarization", - "SaocomSensorMode" "TsxProduct", + "SaocomSensorModeTsxProduct", "TsxPolarization", "TsxSatId", "TsxProductType", "TsxSensorMode", "CapellaProduct", "CapellaProductType", - "CapellaSensorMode" "", + "CapellaSensorMode", ] from .sar.sar_product import SarProduct, SarProductType, SnapDems from .sar.cosmo_product import CosmoProduct, CosmoProductType diff --git a/eoreader/products/custom_product.py b/eoreader/products/custom_product.py index a6c4f25c..7856a89f 100644 --- a/eoreader/products/custom_product.py +++ b/eoreader/products/custom_product.py @@ -147,9 +147,9 @@ def _map_bands(self): band_map = {} for key, val in band_names.items(): band_name = to_band(key)[0] - assert is_sat_band( - band_name - ), f"{band_name}: Custom bands should be satellite band" + assert is_sat_band(band_name), ( + f"{band_name}: Custom bands should be satellite band" + ) band_map[band_name] = band( eoreader_name=band_name, name=band_name.value, id=val ) @@ -158,9 +158,9 @@ def _map_bands(self): # Test on the product with rasterio.open(str(self.get_default_band_path())) as ds: - assert ( - len(band_names) == ds.count - ), f"You should specify {ds.count} bands in band_map, not {len(band_names)} !" + assert len(band_names) == ds.count, ( + f"You should specify {ds.count} bands in band_map, not {len(band_names)} !" + ) def _post_init(self, **kwargs) -> None: """ diff --git a/eoreader/products/optical/s3_product.py b/eoreader/products/optical/s3_product.py index 8e56918c..eddbe464 100644 --- a/eoreader/products/optical/s3_product.py +++ b/eoreader/products/optical/s3_product.py @@ -615,9 +615,9 @@ def _geocode( xr.DataArray: Geocoded DataArray """ rs_methods = [Resampling.nearest, Resampling.bilinear] - assert ( - resampling in rs_methods - ), f"resampling method ({resampling}) should be chosen among {rs_methods}" + assert resampling in rs_methods, ( + f"resampling method ({resampling}) should be chosen among {rs_methods}" + ) # Open lat/lon arrays geo_file = self._replace(self._geo_file, suffix=suffix)