Commit 18b3f12
committed
Address review: shallow-copy lazy backend and assert laziness
- Use copy.copy instead of copy.deepcopy for the preserved lazy backend
in Image.__deepcopy__: the backend is a read-only access adapter, so a
shallow copy preserves the derived crop/pad view without deep-copying
nibabel/zarr internals or duplicating open I/O resources.
- Assert the padded lazy image stays unloaded before and after deepcopy
so the test exercises the lazy-backend code path.1 parent 2402305 commit 18b3f12
2 files changed
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1165 | 1165 | | |
1166 | 1166 | | |
1167 | 1167 | | |
1168 | | - | |
| 1168 | + | |
1169 | 1169 | | |
1170 | 1170 | | |
1171 | 1171 | | |
| |||
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | | - | |
1187 | | - | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1188 | 1190 | | |
1189 | 1191 | | |
1190 | 1192 | | |
| |||
1198 | 1200 | | |
1199 | 1201 | | |
1200 | 1202 | | |
1201 | | - | |
| 1203 | + | |
1202 | 1204 | | |
1203 | 1205 | | |
1204 | 1206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
580 | 580 | | |
581 | 581 | | |
582 | 582 | | |
| 583 | + | |
583 | 584 | | |
584 | 585 | | |
585 | 586 | | |
| 587 | + | |
586 | 588 | | |
587 | 589 | | |
588 | 590 | | |
| |||
0 commit comments