Skip to content

Commit fae2531

Browse files
This function should not be here
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
1 parent 3aefe1b commit fae2531

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

terratorch/datamodules/generic_scalar_label_data_module.py

+1-17
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,12 @@
2222
HLSBands,
2323
)
2424

25+
from terratorch.io.file import load_from_file_or_attribute
2526

2627
def wrap_in_compose_is_list(transform_list):
2728
# set check shapes to false because of the multitemporal case
2829
return A.Compose(transform_list, is_check_shapes=False) if isinstance(transform_list, Iterable) else transform_list
2930

30-
31-
def load_from_file_or_attribute(value: list[float]|str):
32-
33-
if isinstance(value, list):
34-
return value
35-
elif isinstance(value, str): # It can be the path for a file
36-
if os.path.isfile(value):
37-
try:
38-
content = np.genfromtxt(value).tolist()
39-
except:
40-
raise Exception(f"File must be txt, but received {value}")
41-
else:
42-
raise Exception(f"The input {value} does not exist or is not a file.")
43-
44-
return content
45-
46-
4731
class Normalize(Callable):
4832
def __init__(self, means, stds):
4933
super().__init__()

0 commit comments

Comments
 (0)