Skip to content

allow config_file=None in bundle run#5470

Merged
wyli merged 2 commits intoProject-MONAI:devfrom
wyli:allow-empty-config
Nov 4, 2022
Merged

allow config_file=None in bundle run#5470
wyli merged 2 commits intoProject-MONAI:devfrom
wyli:allow-empty-config

Conversation

@wyli
Copy link
Copy Markdown
Contributor

@wyli wyli commented Nov 4, 2022

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

Description

allow config_file=None when running python -m monai.bundle run,

this enables convenient quick runs via CLI, for example:

python -m monai.bundle run my_test --my_test="$print('hello')"
python -m monai.bundle run my_test --my_test="{_target_: LoadImage}"

output after this PR:

`config_file` not provided for 'monai.bundle run'.
2022-11-04 12:16:42,463 - INFO - --- input summary of monai.bundle.scripts.run ---
2022-11-04 12:16:42,463 - INFO - > runner_id: 'my_test'
2022-11-04 12:16:42,463 - INFO - > my_test: {'_target_': 'LoadImage'}
2022-11-04 12:16:42,463 - INFO - ---


<monai.transforms.io.array.LoadImage object at 0x7f80e2d05790>

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
Copy link
Copy Markdown
Contributor Author

wyli commented Nov 4, 2022

/build

@wyli wyli enabled auto-merge (squash) November 4, 2022 15:46
@wyli wyli merged commit 288eb6a into Project-MONAI:dev Nov 4, 2022
wyli added a commit that referenced this pull request Nov 6, 2022
Signed-off-by: Wenqi Li <[email protected]>

### Description
allow `config_file=None` when running `python -m monai.bundle run`,

this enables convenient quick runs via CLI, for example:
```bash
python -m monai.bundle run my_test --my_test="$print('hello')"
```

```bash
python -m monai.bundle run my_test --my_test="{_target_: LoadImage}"
```

output after this PR:
```
`config_file` not provided for 'monai.bundle run'.
2022-11-04 12:16:42,463 - INFO - --- input summary of monai.bundle.scripts.run ---
2022-11-04 12:16:42,463 - INFO - > runner_id: 'my_test'
2022-11-04 12:16:42,463 - INFO - > my_test: {'_target_': 'LoadImage'}
2022-11-04 12:16:42,463 - INFO - ---


<monai.transforms.io.array.LoadImage object at 0x7f80e2d05790>
```

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] 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.

Signed-off-by: Wenqi Li <[email protected]>
@wyli wyli deleted the allow-empty-config branch December 13, 2022 17:11
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.

2 participants