Project-MONAI / Project-MONAI/MONAI

ValueError: compressor cannot be used for arrays with zarr_format 3

Open
#8,476 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

======================================================================
ERROR: test_zarr_avg_merger_patches_13 (tests.inferers.test_zarr_avg_merger.ZarrAvgMergerTests.test_zarr_avg_merger_patches_13)
----------------------------------------------------------------------
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.

======================================================================
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.

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 in monai/inferers/merger.py around the ZarrAvgMerger constructor and reproduce the failure with tests/inferers/test_zarr_avg_merger.py. Check how the output array is created and compare it with the failing Zarr API message. Done means the affected parameterized tests pass without the compressor and zarr_format error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.