Repository navigation
Commit 8c5bede
authored
perf(test): cache SwinUNETR SSL weights instead of re-downloading (#8987)
### Description
Cache the SwinUNETR SSL pretrained weights (~750 MB) under
`tests/testing_data/` instead of a per-run
`tempfile.TemporaryDirectory()`, so `test_filter_swinunetr` reuses them
across runs instead of re-downloading every time. `download_url` skips
the download when the cached file's hash matches, so repeated runs
replace a ~750 MB download with a local hash-check (~5x faster). The
cache path is gitignored and behavior/coverage are unchanged.
### Changes
- `tests/networks/nets/test_swin_unetr.py`: download the weights to
`tests/testing_data/temp_ssl_pretrained_weights.pth` (new `TESTS_PATH`
constant) instead of a temporary directory; drop the `tempfile` import
and add `from pathlib import Path`.
### Types of changes
- [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`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated.
Signed-off-by: Soumya Snigdha Kundu <soumya_snigdha.kundu@kcl.ac.uk>1 parent 5a61f40 commit 8c5bede
1 file changed
Lines changed: 15 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
0 commit comments