Skip to content

Commit fee7129

Browse files
committed
improve docstring comments
1 parent 3faf7d3 commit fee7129

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

terratorch/datasets/generic_pixel_wise_dataset.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
"""Module containing generic dataset classes"""
44

55
import glob
6-
import operator
76
import os
87
from abc import ABC
9-
from functools import reduce
108
from pathlib import Path
119
from typing import Any
1210

@@ -71,8 +69,8 @@ def __init__(
7169
that must be present in file names to be included (as in mmsegmentation), or exact
7270
matches (e.g. eurosat). Defaults to True.
7371
rgb_indices (list[str], optional): Indices of RGB channels. Defaults to [0, 1, 2].
74-
dataset_bands (list[HLSBands | int] | None): Bands present in the dataset.
75-
output_bands (list[HLSBands | int] | None): Bands that should be output by the dataset.
72+
dataset_bands (list[HLSBands | int | tuple[int, int] | str] | None): Bands present in the dataset. This parameter names input channels (bands) using HLSBands, ints, int ranges, or strings, so that they can then be refered to by output_bands. Defaults to None.
73+
output_bands (list[HLSBands | int | tuple[int, int] | str] | None): Bands that should be output by the dataset as named by dataset_bands.
7674
constant_scale (float): Factor to multiply image values by. Defaults to 1.
7775
transform (Albumentations.Compose | None): Albumentations transform to be applied.
7876
Should end with ToTensorV2(). If used through the generic_data_module,
@@ -193,6 +191,7 @@ def _generate_bands_intervals(self, bands_intervals: list[int | str | HLSBands |
193191
raise Exception(msg)
194192
return bands
195193

194+
196195
class GenericNonGeoSegmentationDataset(GenericPixelWiseDataset):
197196
"""GenericNonGeoSegmentationDataset"""
198197

terratorch/datasets/generic_scalar_label_dataset.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def __init__(
4242
ignore_split_file_extensions: bool = True,
4343
allow_substring_split_file: bool = True,
4444
rgb_indices: list[int] | None = None,
45-
dataset_bands: list[HLSBands | int] | None = None,
46-
output_bands: list[HLSBands | int] | None = None,
45+
dataset_bands: list[HLSBands | int | tuple[int, int] | str] | None = None,
46+
output_bands: list[HLSBands | int | tuple[int, int] | str] | None = None,
4747
constant_scale: float = 1,
4848
transform: A.Compose | None = None,
4949
no_data_replace: float = 0,
@@ -64,8 +64,8 @@ def __init__(
6464
that must be present in file names to be included (as in mmsegmentation), or exact
6565
matches (e.g. eurosat). Defaults to True.
6666
rgb_indices (list[str], optional): Indices of RGB channels. Defaults to [0, 1, 2].
67-
dataset_bands (list[HLSBands | int] | None): Bands present in the dataset.
68-
output_bands (list[HLSBands | int] | None): Bands that should be output by the dataset.
67+
dataset_bands (list[HLSBands | int | tuple[int, int] | str] | None): Bands present in the dataset. This parameter names input channels (bands) using HLSBands, ints, int ranges, or strings, so that they can then be refered to by output_bands. Defaults to None.
68+
output_bands (list[HLSBands | int | tuple[int, int] | str] | None): Bands that should be output by the dataset as named by dataset_bands.
6969
constant_scale (float): Factor to multiply image values by. Defaults to 1.
7070
transform (Albumentations.Compose | None): Albumentations transform to be applied.
7171
Should end with ToTensorV2(). If used through the generic_data_module,

0 commit comments

Comments
 (0)