Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6602 Update bundle properties #6607

Merged
merged 4 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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": {
yiheng-wang-nv marked this conversation as resolved.
Show resolved Hide resolved
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
wyli marked this conversation as resolved.
Show resolved Hide resolved
},
"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