Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions monai/bundle/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,17 @@
BundleProperty.REQUIRED: True,
BundlePropertyConfig.ID: f"train{ID_SEP_KEY}dataset",
},
"train_dataset_data": {
BundleProperty.DESC: "data source for the training dataset.",
BundleProperty.REQUIRED: True,
BundlePropertyConfig.ID: f"train{ID_SEP_KEY}dataset{ID_SEP_KEY}data",
},
"train_inferer": {
BundleProperty.DESC: "MONAI Inferer object to execute the model computation in training.",
BundleProperty.REQUIRED: True,
BundlePropertyConfig.ID: f"train{ID_SEP_KEY}inferer",
},
"train_dataset_data": {
BundleProperty.DESC: "data source for the training dataset.",
BundleProperty.REQUIRED: False,
BundlePropertyConfig.ID: f"train{ID_SEP_KEY}dataset{ID_SEP_KEY}data",
BundlePropertyConfig.REF_ID: None, # no reference to this ID
},
"train_handlers": {
BundleProperty.DESC: "event-handlers for the training logic.",
BundleProperty.REQUIRED: False,
Expand Down Expand Up @@ -169,11 +170,6 @@
BundleProperty.REQUIRED: True,
BundlePropertyConfig.ID: "dataset",
},
"dataset_data": {
BundleProperty.DESC: "data source for the inference / evaluation dataset.",
BundleProperty.REQUIRED: True,
BundlePropertyConfig.ID: f"dataset{ID_SEP_KEY}data",
},
"evaluator": {
BundleProperty.DESC: "inference / evaluation workflow engine.",
BundleProperty.REQUIRED: True,
Expand All @@ -189,6 +185,12 @@
BundleProperty.REQUIRED: True,
BundlePropertyConfig.ID: "inferer",
},
"dataset_data": {
BundleProperty.DESC: "data source for the inference / evaluation dataset.",
BundleProperty.REQUIRED: False,
BundlePropertyConfig.ID: f"dataset{ID_SEP_KEY}data",
BundlePropertyConfig.REF_ID: None, # no reference to this ID
},
"handlers": {
BundleProperty.DESC: "event-handlers for the inference / evaluation logic.",
BundleProperty.REQUIRED: False,
Expand Down
1 change: 1 addition & 0 deletions monai/bundle/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def _check_optional_id(self, name: str, property: dict) -> bool:
# no ID of reference config item, skipping check for this optional property
return True
# check validation `validator` and `interval` properties as the handler index of ValidationHandler is unknown
ref: str | None = None
if name in ("evaluator", "val_interval"):
if f"train{ID_SEP_KEY}handlers" in self.parser:
for h in self.parser[f"train{ID_SEP_KEY}handlers"]:
Expand Down
1 change: 1 addition & 0 deletions monai/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ class BundlePropertyConfig(StrEnum):
additional bundle property fields for config based bundle workflow:
`ID` is the config item ID of the property.
`REF_ID` is the ID of config item which is supposed to refer to this property.
For properties that do not have `REF_ID`, `None` should be set.
this field is only useful to check the optional property ID.
"""

Expand Down