11
11
from kerchunk .open_meteo import SingleOmToZarr , SupportedDomain
12
12
from kerchunk .utils import fs_as_store
13
13
14
+ zarr .config .config ["async" ]["concurrency" ] = 1
14
15
15
16
def test_single_om_to_zarr ():
16
17
# Path to test file - adjust as needed
@@ -44,6 +45,7 @@ def test_single_om_to_zarr():
44
45
z = group ["data" ] # Here we just use a dummy data name we have hardcoded in SingleOmToZarr
45
46
46
47
print ("z.shape" , z .shape )
48
+ print ("z.chunks" , z .chunks )
47
49
48
50
# Verify basic metadata matches original file
49
51
reader = omfiles .OmFilePyReader (test_file )
@@ -52,11 +54,12 @@ def test_single_om_to_zarr():
52
54
assert list (z .chunks ) == reader .chunk_dimensions , f"Chunks mismatch: { z .chunks } vs { reader .chunk_dimensions } "
53
55
54
56
# TODO: Using the following chunk_index leads to a double free / corruption error!
55
- # Most likely, because zarr and open-meteo treat partial chunks differently.
57
+ # Even with a concurrency of 1: `zarr.config.config["async"]["concurrency"] = 1`
58
+ # Most likely, because zarr and open-meteo treat partial chunks differently:
56
59
# om-files encode partial chunks with a reduced dimension, while zarr most likely expects a full block of data?
57
- # chunk_index = (slice(0 , 100), 2878, ...)
60
+ # chunk_index = (slice(90 , 100), 2878, ...)
58
61
59
- # Test retrieving a specific chunk (same chunk as in your example)
62
+ # Test retrieving a specific chunk
60
63
chunk_index = (5 , 5 , ...)
61
64
62
65
# Get direct chunk data
0 commit comments