Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #203

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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