Skip to content

Commit 70f3707

Browse files
Minor issues solved
Signed-off-by: João Lucas de Sousa Almeida <[email protected]>
1 parent ad2e445 commit 70f3707

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

terratorch/datamodules/generic_scalar_label_data_module.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ def wrap_in_compose_is_list(transform_list):
2929

3030
def load_from_file_or_attribute(value:list[float] | str):
3131

32-
if type(value) == list:
32+
if isinstance(value, list):
3333
return value
34-
elif type(str): # It can be the path for a file
34+
elif isinstance(value, str): # It can be the path for a file
3535
if os.path.isfile(value):
3636
try:
3737
content = np.genfromtxt(value).tolist()
3838
except:
3939
raise Exception(f"File must be txt, but received {value}")
4040
else:
41-
raise Exception("It seems that {value} does not exist or is not a file.")
41+
raise Exception(f"The input {value} does not exist or is not a file.")
4242

4343
return content
4444

0 commit comments

Comments
 (0)