@@ -70,10 +70,10 @@ def test_opsi_index_accepts_non_multiple_chunk_and_block_lengths():
7070 [
7171 (1 , 1 ),
7272 (3 , 2 ),
73- (4 , 4 ),
74- (6 , 4 ),
75- (7 , 8 ),
76- (9 , 16 ),
73+ (4 , 2 ),
74+ (6 , 2 ),
75+ (7 , 3 ),
76+ (9 , 4 ),
7777 ],
7878)
7979def test_opsi_optlevel_controls_chunk_multiplier (optlevel , expected_multiplier ):
@@ -99,10 +99,10 @@ def test_opsi_optlevel_controls_chunk_multiplier(optlevel, expected_multiplier):
9999 [
100100 (1 , 1 ),
101101 (3 , 2 ),
102- (4 , 4 ),
103- (6 , 4 ),
104- (7 , 8 ),
105- (9 , 16 ),
102+ (4 , 2 ),
103+ (6 , 2 ),
104+ (7 , 3 ),
105+ (9 , 4 ),
106106 ],
107107)
108108def test_chunk_local_indexes_optlevel_controls_chunk_multiplier (kind , optlevel , expected_multiplier ):
@@ -554,7 +554,7 @@ def test_chunk_local_index_descriptor_and_lookup_path(tmp_path, kind):
554554 meta = descriptor ["bucket" ] if kind == "bucket" else descriptor ["partial" ]
555555
556556 assert meta ["layout" ] == "chunk-local-v1"
557- expected_chunk_multiplier = 4
557+ expected_chunk_multiplier = 2
558558 expected_chunk_len = arr .chunks [0 ] * expected_chunk_multiplier
559559 assert meta ["chunk_multiplier" ] == expected_chunk_multiplier
560560 assert meta ["chunk_len" ] == expected_chunk_len
@@ -1237,21 +1237,20 @@ def test_forced_ooc_full_index_merge_preserves_sorted_sidecars(monkeypatch, tmp_
12371237
12381238
12391239@pytest .mark .parametrize (
1240- ("optlevel" , "expected_multiplier" , "expected_budget" ),
1240+ ("optlevel" , "expected_multiplier" ),
12411241 [
1242- (1 , 1 , 1024 / 2 ),
1243- (3 , 2 , 1 * 1024 ),
1244- (4 , 4 , 2 * 1024 ),
1245- (6 , 4 , 2 * 1024 ),
1246- (7 , 8 , 4 * 1024 ),
1247- (9 , 16 , 8 * 1024 ),
1242+ (1 , 1 ),
1243+ (3 , 2 ),
1244+ (4 , 2 ),
1245+ (6 , 2 ),
1246+ (7 , 3 ),
1247+ (9 , 4 ),
12481248 ],
12491249)
1250- def test_full_ooc_run_items_follow_optlevel (
1251- monkeypatch , tmp_path , optlevel , expected_multiplier , expected_budget
1252- ):
1250+ def test_full_ooc_run_items_follow_optlevel (monkeypatch , tmp_path , optlevel , expected_multiplier ):
1251+ nitems = 4096
12531252 path = tmp_path / f"full_ooc_optlevel_{ optlevel } .b2nd"
1254- data = np .arange (4096 , dtype = np .int64 )
1253+ data = np .arange (nitems , dtype = np .int64 )
12551254 arr = blosc2 .asarray (data , urlpath = path , mode = "w" , chunks = (256 ,), blocks = (64 ,))
12561255 indexing = __import__ ("blosc2.indexing" , fromlist = ["FULL_OOC_RUN_ITEMS" ])
12571256 monkeypatch .setattr (indexing , "FULL_OOC_RUN_ITEMS" , 512 )
@@ -1260,6 +1259,7 @@ def test_full_ooc_run_items_follow_optlevel(
12601259 full = descriptor ["full" ]
12611260
12621261 expected_sidecar_chunk_len = arr .chunks [0 ] * expected_multiplier
1262+ expected_budget = expected_multiplier * (nitems / 8 )
12631263 assert full ["ooc_run_item_budget" ] == expected_budget
12641264 assert full ["ooc_run_items" ] == max (expected_sidecar_chunk_len , min (arr .size , expected_budget ))
12651265 assert full ["ooc_run_item_budget_source" ] == "optlevel"
0 commit comments