Commit aa58ffa
Workaround for KeyError 'ome' when writing multiscale images (#1115)
* fix: workaround for KeyError 'ome' when writing multiscale with processes scheduler (#1024)
Re-open the zarr group after da.compute() in _write_raster_datatree so
that the main process picks up metadata written by ome-zarr-py's delayed
write_multiscales_metadata() task, which runs in a subprocess under the
'processes' scheduler and leaves the original in-memory GroupMetadata stale.
The fresh group is returned to _write_raster so the subsequent spatialdata
attrs write also uses the correct on-disk state.
Upstream issue: ome/ome-zarr-py#580
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: use use_consolidated=False when re-opening group after compute
The re-open after da.compute() was inheriting stale consolidated metadata,
which caused KeyError when newly written children (e.g. labels3d_multiscale_xarray)
were not yet reflected in it. Passing use_consolidated=False forces zarr to
read group membership directly from the store instead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 8d7f72f commit aa58ffa
2 files changed
Lines changed: 34 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
| 412 | + | |
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
463 | 472 | | |
464 | 473 | | |
465 | 474 | | |
466 | 475 | | |
467 | 476 | | |
468 | 477 | | |
469 | 478 | | |
| 479 | + | |
470 | 480 | | |
471 | 481 | | |
472 | 482 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments