We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 206f7a4 commit e6bc3c3Copy full SHA for e6bc3c3
1 file changed
src/graphnet/training/utils.py
@@ -351,8 +351,11 @@ def add_custom_labels(
351
for key, fn in custom_label_functions.items():
352
try:
353
label = fn(data)
354
- except KeyError:
355
- raise KeyError(f"Key {key} not found in data.")
+ except KeyError as e:
+ raise KeyError(
356
+ f"Label '{key}' could not be computed because "
357
+ f"its required data field {e} is missing."
358
+ ) from e
359
if repeat_labels_by is not None:
360
label = label.repeat(data.x.shape[repeat_labels_by], 1)
361
data[key] = label
0 commit comments