Skip to content

Commit

Permalink
reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
dcodrut committed Jan 13, 2025
1 parent d5413cb commit 890af53
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions torchgeo/datasets/glacier_mapping_alps.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@ def __init__(

# sanity checks
assert split in self.valid_splits, f'Split {split} not in: {self.valid_splits}'
assert (
cv_iter in self.valid_cv_iters
), f'Cross-validation iteration {cv_iter} not in: {self.valid_cv_iters}'
assert (
version in self.valid_versions
), f'Version {version} not in: {self.valid_versions}'
assert cv_iter in self.valid_cv_iters, (
f'Cross-validation iteration {cv_iter} not in: {self.valid_cv_iters}'
)
assert version in self.valid_versions, (
f'Version {version} not in: {self.valid_versions}'
)
for band in bands:
assert band in self.all_bands, f'Band {band} not in: {self.all_bands}'
if extra_features:
for feature in extra_features:
assert (
feature in self.valid_extra_features
), f'Feature {feature} not in: {self.valid_extra_features}'
assert feature in self.valid_extra_features, (
f'Feature {feature} not in: {self.valid_extra_features}'
)

# set the local file paths
label = f'dataset_{version}'
Expand Down Expand Up @@ -301,7 +301,7 @@ def _prepare_files(self) -> None:

# get the glacier IDs of the current split of the cross-validation
self.df_splits = pd.read_csv(self.fp_splits_csv)
fold_name = f"fold_{self.split if self.split != 'val' else 'valid'}"
fold_name = f'fold_{self.split if self.split != "val" else "valid"}'
idx = self.df_splits[f'split_{self.cv_iter}'] == fold_name
glacier_ids = list(self.df_splits.loc[idx, 'entry_id'])

Expand Down Expand Up @@ -329,9 +329,9 @@ def plot(
a matplotlib Figure with the rendered sample
"""
# we expect the RGB bands to be present
assert {'B4', 'B3', 'B2'}.issubset(
set(self.bands)
), 'RGB bands not found in the available bands.'
assert {'B4', 'B3', 'B2'}.issubset(set(self.bands)), (
'RGB bands not found in the available bands.'
)
nir_and_swir_present = {'B8', 'B11'}.issubset(set(self.bands))

# prepare the RGB image and the masks
Expand Down

0 comments on commit 890af53

Please sign in to comment.