Skip to content

5869 adds support of _mode_ keyword in instantiate#5880

Merged
wyli merged 4 commits intoProject-MONAI:devfrom
wyli:5869-suppport-callable-inst
Jan 23, 2023
Merged

5869 adds support of _mode_ keyword in instantiate#5880
wyli merged 4 commits intoProject-MONAI:devfrom
wyli:5869-suppport-callable-inst

Conversation

@wyli
Copy link
Copy Markdown
Contributor

@wyli wyli commented Jan 19, 2023

Signed-off-by: Wenqi Li [email protected]

Fixes #5869

Description

support an optional _mode_ in "default"/"partial"/"debug" when calling component(**kwargs)

example config:

{"xform": 
    {"_target_": "Compose", 
     "transforms": [], 
     "_mode_": "debug"}}

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@wyli wyli requested review from Nic-Ma, ericspod and rijobro January 19, 2023 18:23
@wyli wyli marked this pull request as ready for review January 19, 2023 19:01
wyli added 2 commits January 20, 2023 11:36
Signed-off-by: Wenqi Li <[email protected]>
Signed-off-by: Wenqi Li <[email protected]>
@wyli wyli force-pushed the 5869-suppport-callable-inst branch from a24d05a to 2903717 Compare January 20, 2023 12:10
@wyli wyli changed the title 5899 adds support of _mode_ keyword in instantiate 5869 adds support of _mode_ keyword in instantiate Jan 21, 2023
Copy link
Copy Markdown
Contributor

@Nic-Ma Nic-Ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR slightly changed the default behavior of ConfigComponent for functions, but I think it's acceptable because now it's same as Hydra and other similar projects:
https://github.com/facebookresearch/hydra/blob/main/hydra/_internal/instantiate/_instantiate2.py#L283

Thanks.

@wyli
Copy link
Copy Markdown
Contributor Author

wyli commented Jan 23, 2023

/build

@wyli wyli enabled auto-merge (squash) January 23, 2023 18:30
@wyli wyli merged commit af0779c into Project-MONAI:dev Jan 23, 2023
@wyli wyli deleted the 5869-suppport-callable-inst branch January 27, 2023 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supporting callable functions in instantiate

2 participants