Skip to content

Commit 5983dd7

Browse files
thomas-mattssonIsabelle-Wittmann
authored andcommitted
Fixed logic for tortilla file vs data roots
Signed-off-by: Thomas Mattsson <thomas.mattsson@se.ibm.com>
1 parent c019249 commit 5983dd7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

terratorch/datamodules/generic_pixel_wise_data_module.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,11 @@ def __init__(
216216

217217
self.check_stackability = check_stackability
218218

219-
if tortilla_file is None and not all([
220-
train_data_root,
221-
val_data_root,
222-
test_data_root
223-
]
224-
):
225-
raise MisconfigurationException("Either provide tortilla_file OR all train/val/test roots.")
219+
if tortilla_file is not None and any([train_data_root, val_data_root, test_data_root]):
220+
raise MisconfigurationException(
221+
"Cannot provide both tortilla_file and train_data_root/val_data_root/test_data_root. "
222+
"Use tortilla_file OR data roots (not both)."
223+
)
226224

227225
self.tortilla_df = tacoreader.load(str(tortilla_file)) if tortilla_file is not None else None
228226

0 commit comments

Comments
 (0)