Project-MONAI / Project-MONAI/MONAI

ValueError: compressor cannot be used for arrays with zarr_format 3

Open
#8,459 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.7k
Forks
1.6k
Avg merge
5d 1h
Merged PRs (30d)
20

Description

======================================================================
ERROR: test_zarr_avg_merger_patches_14 (tests.inferers.test_zarr_avg_merger.ZarrAvgMergerTests.test_zarr_avg_merger_patches_14)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/parameterized/parameterized.py", line 620, in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/MONAI/MONAI/tests/inferers/test_zarr_avg_merger.py", line 301, in test_zarr_avg_merger_patches
    merger = ZarrAvgMerger(**arguments)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/MONAI/MONAI/monai/utils/module.py", line 477, in _wrapper
    return call_obj(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/MONAI/MONAI/monai/inferers/merger.py", line 273, in __init__
    self.output = zarr.empty(
                  ^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/zarr/api/synchronous.py", line 1151, in empty
    return Array(sync(async_api.empty(shape, **kwargs)))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/zarr/core/sync.py", line 163, in sync
    raise return_result
  File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/zarr/core/sync.py", line 119, in _runner
    return await coro
           ^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/zarr/api/asynchronous.py", line 1097, in empty
    return await create(shape=shape, fill_value=None, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/zarr/api/asynchronous.py", line 1055, in create
    return await AsyncArray._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/zarr/core/array.py", line 600, in _create
    raise ValueError(
ValueError: compressor cannot be used for arrays with zarr_format 3. Use bytes-to-bytes codecs instead.

Refer to: https://github.com/Project-MONAI/MONAI/actions/runs/15213059543/job/42794428039

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/inferers/test_zarr_avg_merger.py, especially test_zarr_avg_merger_patches at line 301, then inspect monai/inferers/merger.py around line 273 where ZarrAvgMerger creates its output. Run the failing test and update the Zarr array creation so it works with the reported format; done means the test passes without the ValueError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.