Skip to content

Commit

Permalink
Merge pull request #203 from sertit/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
remi-braun authored Feb 4, 2025
2 parents 025bf52 + 1a070b0 commit 3caa84a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ci/scripts_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions eoreader/products/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions eoreader/products/custom_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand All @@ -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:
"""
Expand Down
6 changes: 3 additions & 3 deletions eoreader/products/optical/s3_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3caa84a

Please sign in to comment.