Skip to content

Commit f28e5c5

Browse files
committed
Fix type hints
1 parent 551b7ee commit f28e5c5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

torchgeo/datasets/sentinel.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ class Sentinel2(Sentinel):
281281
"""
282282

283283
# https://sentiwiki.copernicus.eu/web/s2-mission
284-
all_bands = (
284+
all_bands: tuple[str, ...] = (
285285
'B01',
286286
'B02',
287287
'B03',

torchgeo/datasets/ssl4eo.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ class _Metadata(TypedDict):
365365
filename: str
366366
md5: str
367367
bands: list[str]
368+
filename_regex: str
368369

369370
metadata: ClassVar[dict[str, _Metadata]] = {
370371
's1': {
@@ -467,7 +468,7 @@ def __getitem__(self, index: int) -> dict[str, Any]:
467468

468469
images = []
469470
bounds = []
470-
wavelengths = []
471+
wavelengths: list[float] = []
471472
for subdir in subdirs:
472473
directory = os.path.join(root, subdir)
473474
if match := re.match(filename_regex, subdir):
@@ -488,7 +489,7 @@ def __getitem__(self, index: int) -> dict[str, Any]:
488489
images.append(torch.from_numpy(image.astype(np.float32)))
489490
bounds.append(BoundingBox(minx, maxx, miny, maxy, mint, maxt))
490491

491-
sample = {
492+
sample: dict[str, Any] = {
492493
'image': torch.cat(images),
493494
'bounds': bounds,
494495
'wavelengths': wavelengths,

0 commit comments

Comments
 (0)