We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad2e445 commit 70f3707Copy full SHA for 70f3707
terratorch/datamodules/generic_scalar_label_data_module.py
@@ -29,16 +29,16 @@ def wrap_in_compose_is_list(transform_list):
29
30
def load_from_file_or_attribute(value:list[float] | str):
31
32
- if type(value) == list:
+ if isinstance(value, list):
33
return value
34
- elif type(str): # It can be the path for a file
+ elif isinstance(value, str): # It can be the path for a file
35
if os.path.isfile(value):
36
try:
37
content = np.genfromtxt(value).tolist()
38
except:
39
raise Exception(f"File must be txt, but received {value}")
40
else:
41
- raise Exception("It seems that {value} does not exist or is not a file.")
+ raise Exception(f"The input {value} does not exist or is not a file.")
42
43
return content
44
0 commit comments