You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#337 .
### Description
This PR adds unit tests scripts, as well as test files on brats
segmentation and spleen ct segmentation bundles. Tests are for both
single GPU and multiple GPUs.
In addition, the PR also enhances the current Blossom CI pipelines. For
PRs that do not need to use GPU or multiple GPUs, the pipeline will not
wait for resources first.
### Status
**Ready**
### Please ensure all the checkboxes:
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Codeformat tests passed locally by running `./runtests.sh
--codeformat`.
- [ ] In-line docstrings updated.
- [ ] Update `version` and `changelog` in `metadata.json` if changing an
existing bundle.
- [ ] Please ensure the naming rules in config files meet our
requirements (please refer to: `CONTRIBUTING.md`).
- [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy`
are correct in `metadata.json`.
- [ ] Descriptions should be consistent with the content, such as
`eval_metrics` of the provided weights and TorchScript modules.
- [ ] Files larger than 25MB are excluded and replaced by providing
download links in `large_file.yml`.
- [ ] Avoid using path that contains personal information within config
files (such as use `/home/your_name/` for `"bundle_root"`).
---------
Signed-off-by: Yiheng Wang <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ In train config file (if exists), please follow the following requirements in or
80
80
1. If `ValidationHandler` is used, please define the key `val_interval` and use it for the argument `interval`.
81
81
82
82
83
-
## Verifying the bundle
83
+
## Verifying a bundle
84
84
85
85
We prepared several premerge CI tests to verify your bundle.
86
86
@@ -89,7 +89,7 @@ We prepared several premerge CI tests to verify your bundle.
89
89
For dependencies that support `pip install` command, please put them into `optional_packages_version` in `configs/metadata.json` ([click here for instance](https://github.com/Project-MONAI/model-zoo/blob/dev/models/brats_mri_segmentation/configs/metadata.json)), and the CI test program will extract and install all libraries directly before running tests.
90
90
For dependencies that require multiple steps to install, please prepare a install script in `ci/install_scripts`, and put the bundle name and the script path into `install_dependency_dict` in `ci/bundle_custom_data.py` ([click here for instance](https://github.com/Project-MONAI/model-zoo/tree/dev/ci/install_scripts/)).
91
91
92
-
### Necessary verifications
92
+
### Necessary tests
93
93
94
94
1. Check if necessary files are existing in your bundle.
95
95
1. Check if keys naming are consistent with our requirements.
@@ -100,7 +100,7 @@ For dependencies that require multiple steps to install, please prepare a instal
Check if the input and output data shape and data type of network defined in the metadata are correct. You can also run the following command locally to verify your bundle before submitting a pull request.
If your bundle does not support TensorRT compilation, please mention it in `docs/README.md`.
158
158
159
+
#### Customized unit tests
160
+
It is recommended to prepare unit tests on your bundle. The main purpose is to ensure each config file is runnable.
161
+
Please create a file called `test_<bundle_name>.py` in `ci/unit_tests/` (like this [example](./ci/unit_tests/test_spleen_ct_segmentation.py)), and you can define the testing scope within the file.
162
+
If multi-gpu config files are also need to be tested, please create a separate file called `test_<bundle_name>_dist.py` in the same directory (like this [example](./ci/unit_tests/test_spleen_ct_segmentation_dist.py)).
159
163
160
-
##Checking the coding style
164
+
### Code format tests
161
165
162
-
After verifying your bundle, if there are any `.py` files, coding style is checked and enforced by flake8, black, isort, pytype and mypy.
163
-
Before submitting a pull request, we recommend that all checks should pass, by running the following command locally:
166
+
If there are any `.py` files in your bundle, coding style is checked and enforced by `flake8`, `black`, `isort`and `pytype`.
167
+
Before submitting a pull request, we recommend that all checks should pass by running the following command locally:
164
168
165
169
```bash
166
170
# optionally update the dependencies and dev tools
@@ -191,6 +195,7 @@ Ideally, the new branch should be based on the latest `dev` branch.
191
195
192
196
[monai model zoo issue list]: https://github.com/Project-MONAI/model-zoo/issues
193
197
198
+
194
199
## Validate and release
195
200
196
201
As for a pull request, a CI program will try to download all large files if mentioned and do several validations. If the pull request is approved and merged, the full bundle (with all large files if exists) will be archived and send to [Releases](https://github.com/Project-MONAI/model-zoo/releases).
0 commit comments