@@ -53,11 +53,6 @@ def _edges(grid: ChunkGrid, dim: int) -> tuple[int, ...]:
5353 raise TypeError (f"Unexpected dimension type: { type (d )} " )
5454
5555
56- # ---------------------------------------------------------------------------
57- # Index to chunk
58- # ---------------------------------------------------------------------------
59-
60-
6156class TestVaryingDimensionIndexToChunkBounds :
6257 def test_index_at_extent_raises (self ) -> None :
6358 """index_to_chunk(extent) should raise since extent is out of bounds."""
@@ -92,11 +87,6 @@ def test_last_valid_index_works(self) -> None:
9287 assert dim .index_to_chunk (94 ) == 9
9388
9489
95- # ---------------------------------------------------------------------------
96- # Feature flag gating
97- # ---------------------------------------------------------------------------
98-
99-
10090class TestRectilinearFeatureFlag :
10191 """Test that rectilinear chunks are gated behind the config flag."""
10292
@@ -132,11 +122,6 @@ def test_parse_chunk_grid_blocked(self) -> None:
132122 )
133123
134124
135- # ---------------------------------------------------------------------------
136- # RegularChunkGrid backwards compatibility
137- # ---------------------------------------------------------------------------
138-
139-
140125class TestRegularChunkGridCompat :
141126 """The deprecated RegularChunkGrid shim should work for common patterns."""
142127
@@ -168,11 +153,6 @@ def test_isinstance_false_for_unrelated_types(self) -> None:
168153 assert not isinstance (42 , RegularChunkGrid )
169154
170155
171- # ---------------------------------------------------------------------------
172- # FixedDimension
173- # ---------------------------------------------------------------------------
174-
175-
176156class TestFixedDimension :
177157 def test_basic (self ) -> None :
178158 d = FixedDimension (size = 10 , extent = 100 )
@@ -223,11 +203,6 @@ def test_zero_size_allowed(self) -> None:
223203 # ChunkGrid.__getitem__ which checks before delegating.
224204
225205
226- # ---------------------------------------------------------------------------
227- # VaryingDimension
228- # ---------------------------------------------------------------------------
229-
230-
231206class TestVaryingDimension :
232207 def test_basic (self ) -> None :
233208 d = VaryingDimension ([10 , 20 , 30 ], extent = 60 )
@@ -279,11 +254,6 @@ def test_zero_edge_rejected(self) -> None:
279254 VaryingDimension ([10 , 0 , 5 ], extent = 15 )
280255
281256
282- # ---------------------------------------------------------------------------
283- # ChunkSpec
284- # ---------------------------------------------------------------------------
285-
286-
287257class TestChunkSpec :
288258 def test_basic (self ) -> None :
289259 spec = ChunkSpec (
@@ -302,11 +272,6 @@ def test_boundary(self) -> None:
302272 assert spec .is_boundary
303273
304274
305- # ---------------------------------------------------------------------------
306- # ChunkGrid construction
307- # ---------------------------------------------------------------------------
308-
309-
310275class TestChunkGridConstruction :
311276 def test_from_regular (self ) -> None :
312277 g = ChunkGrid .from_regular ((100 , 200 ), (10 , 20 ))
@@ -341,11 +306,6 @@ def test_all_uniform_becomes_regular(self) -> None:
341306 assert g .chunk_shape == (10 , 25 )
342307
343308
344- # ---------------------------------------------------------------------------
345- # ChunkGrid queries
346- # ---------------------------------------------------------------------------
347-
348-
349309class TestChunkGridQueries :
350310 def test_regular_shape (self ) -> None :
351311 g = ChunkGrid .from_regular ((100 , 200 ), (10 , 20 ))
@@ -453,11 +413,6 @@ def test_iter(self) -> None:
453413 assert all (isinstance (s , ChunkSpec ) for s in specs )
454414
455415
456- # ---------------------------------------------------------------------------
457- # RLE helpers
458- # ---------------------------------------------------------------------------
459-
460-
461416class TestRLE :
462417 def test_expand (self ) -> None :
463418 assert expand_rle ([[10 , 3 ]]) == [10 , 10 , 10 ]
@@ -502,19 +457,14 @@ def test_expand_rejects_negative_rle_count(self) -> None:
502457class TestExpandRleHandlesJsonFloats :
503458 def test_bare_integer_floats_accepted (self ) -> None :
504459 """JSON parsers may emit 10.0 for the integer 10; expand_rle should handle it."""
505- result = expand_rle ([10.0 , 20.0 ])
460+ result = expand_rle ([10.0 , 20.0 ]) # type: ignore[list-item]
506461 assert result == [10 , 20 ]
507462
508463 def test_rle_pair_with_float_count (self ) -> None :
509- result = expand_rle ([[10 , 3.0 ]])
464+ result = expand_rle ([[10 , 3.0 ]]) # type: ignore[list-item]
510465 assert result == [10 , 10 , 10 ]
511466
512467
513- # ---------------------------------------------------------------------------
514- # _decode_dim_spec edge cases
515- # ---------------------------------------------------------------------------
516-
517-
518468class TestDecodeDimSpec :
519469 """Edge cases for _decode_dim_spec: floats, empty lists, negatives, missing extent."""
520470
@@ -560,11 +510,6 @@ def test_none_raises(self) -> None:
560510 _decode_dim_spec (None , array_extent = 10 )
561511
562512
563- # ---------------------------------------------------------------------------
564- # _is_rectilinear_chunks edge cases
565- # ---------------------------------------------------------------------------
566-
567-
568513class TestIsRectilinearChunks :
569514 """Edge cases for _is_rectilinear_chunks."""
570515
@@ -604,11 +549,6 @@ def test_float(self) -> None:
604549 assert _is_rectilinear_chunks (3.14 ) is False
605550
606551
607- # ---------------------------------------------------------------------------
608- # _infer_chunk_grid_name edge cases
609- # ---------------------------------------------------------------------------
610-
611-
612552class TestInferChunkGridName :
613553 """Edge cases for _infer_chunk_grid_name."""
614554
@@ -639,11 +579,6 @@ def test_dict_with_rectilinear_name(self) -> None:
639579 assert _infer_chunk_grid_name (d , g ) == "rectilinear"
640580
641581
642- # ---------------------------------------------------------------------------
643- # Serialization
644- # ---------------------------------------------------------------------------
645-
646-
647582class TestSerialization :
648583 def test_regular_roundtrip (self ) -> None :
649584 g = ChunkGrid .from_regular ((100 , 200 ), (10 , 20 ))
@@ -710,7 +645,7 @@ def test_bare_int_roundtrip(self) -> None:
710645 "name" : "rectilinear" ,
711646 "configuration" : {"kind" : "inline" , "chunk_shapes" : [10 , [20 , 30 ]]},
712647 }
713- meta = RectilinearChunkGrid .from_dict (data )
648+ meta = RectilinearChunkGrid .from_dict (data ) # type: ignore[arg-type]
714649 out = meta .to_dict ()
715650 # Dim 0 was bare int — should stay bare int
716651 assert out ["configuration" ]["chunk_shapes" ][0 ] == 10
@@ -729,7 +664,7 @@ def test_serialize_non_regular_as_regular_raises(self) -> None:
729664 def test_serialize_unknown_name_raises (self ) -> None :
730665 g = ChunkGrid .from_regular ((100 ,), (10 ,))
731666 with pytest .raises (ValueError , match = "Unknown chunk grid name for serialization" ):
732- serialize_chunk_grid (g , "hexagonal" )
667+ serialize_chunk_grid (g , "hexagonal" ) # type: ignore[arg-type]
733668
734669 def test_zero_extent_rectilinear_raises (self ) -> None :
735670 """Zero-extent grids cannot be serialized as rectilinear (spec requires positive edges)."""
@@ -924,11 +859,6 @@ def test_single_chunk_boundary_codec_size_preserved(self) -> None:
924859 assert parsed .dimensions [0 ].chunk_size (0 ) == 10
925860
926861
927- # ---------------------------------------------------------------------------
928- # Indexing with rectilinear grids
929- # ---------------------------------------------------------------------------
930-
931-
932862class TestRectilinearIndexing :
933863 """Test that the indexing pipeline works with VaryingDimension."""
934864
@@ -999,11 +929,6 @@ def test_oob_block_raises_bounds_check_error(self) -> None:
999929 a .get_block_selection ((2 ,))
1000930
1001931
1002- # ---------------------------------------------------------------------------
1003- # End-to-end: array creation with rectilinear chunks
1004- # ---------------------------------------------------------------------------
1005-
1006-
1007932class TestEndToEnd :
1008933 """Test creating, writing, and reading arrays with rectilinear chunk grids."""
1009934
@@ -1158,11 +1083,6 @@ def test_get_chunk_spec_rectilinear(self, tmp_path: Path) -> None:
11581083 assert spec2 .shape == (30 , 50 )
11591084
11601085
1161- # ---------------------------------------------------------------------------
1162- # Sharding compatibility
1163- # ---------------------------------------------------------------------------
1164-
1165-
11661086class TestShardingCompat :
11671087 def test_sharding_accepts_rectilinear_outer_grid (self ) -> None :
11681088 """ShardingCodec.validate should not reject rectilinear outer grids."""
@@ -1180,11 +1100,6 @@ def test_sharding_accepts_rectilinear_outer_grid(self) -> None:
11801100 )
11811101
11821102
1183- # ---------------------------------------------------------------------------
1184- # Edge cases
1185- # ---------------------------------------------------------------------------
1186-
1187-
11881103class TestEdgeCases :
11891104 """Edge cases around boundary chunks, zero-size dims, direct construction,
11901105 and serialization round-trips."""
@@ -1562,11 +1477,6 @@ def test_sharding_accepts_divisible_rectilinear(self) -> None:
15621477 )
15631478
15641479
1565- # ---------------------------------------------------------------------------
1566- # Full-pipeline read/write tests with rectilinear grids
1567- # ---------------------------------------------------------------------------
1568-
1569-
15701480class TestFullPipelineRectilinear :
15711481 """End-to-end read/write tests through the full Array pipeline."""
15721482
@@ -1900,10 +1810,6 @@ def test_nchunks(self, tmp_path: Path) -> None:
19001810 assert z .chunk_grid .get_nchunks () == 12
19011811
19021812
1903- # ---------------------------------------------------------------------------
1904- # Hypothesis property-based tests
1905- # ---------------------------------------------------------------------------
1906-
19071813pytest .importorskip ("hypothesis" )
19081814
19091815import hypothesis .strategies as st # noqa: E402
@@ -1978,11 +1884,6 @@ def test_property_block_indexing_rectilinear(data: st.DataObject) -> None:
19781884 )
19791885
19801886
1981- # ---------------------------------------------------------------------------
1982- # V2 regression tests
1983- # ---------------------------------------------------------------------------
1984-
1985-
19861887class TestV2Regression :
19871888 """Verify V2 arrays still work correctly after the ChunkGrid refactor.
19881889
@@ -2089,11 +1990,6 @@ def test_v2_chunk_spec_via_grid(self, tmp_path: Path) -> None:
20891990 assert spec .codec_shape == (10 , 10 ) # full buffer
20901991
20911992
2092- # ---------------------------------------------------------------------------
2093- # .read_chunk_sizes / .write_chunk_sizes properties
2094- # ---------------------------------------------------------------------------
2095-
2096-
20971993class TestChunkSizes :
20981994 """Tests for ChunkGrid.chunk_sizes and Array.read_chunk_sizes / write_chunk_sizes."""
20991995
@@ -2145,11 +2041,6 @@ def test_array_sharded_chunk_sizes(self) -> None:
21452041 assert arr .write_chunk_sizes == ((120 ,), (80 ,))
21462042
21472043
2148- # ---------------------------------------------------------------------------
2149- # .info display for rectilinear grids
2150- # ---------------------------------------------------------------------------
2151-
2152-
21532044def test_info_display_rectilinear () -> None :
21542045 """Array.info should not crash for rectilinear grids."""
21552046 store = zarr .storage .MemoryStore ()
@@ -2166,11 +2057,6 @@ def test_info_display_rectilinear() -> None:
21662057 assert "Array" in text
21672058
21682059
2169- # ---------------------------------------------------------------------------
2170- # Resize / append for rectilinear grids
2171- # ---------------------------------------------------------------------------
2172-
2173-
21742060class TestUpdateShape :
21752061 """Unit tests for ChunkGrid.update_shape()."""
21762062
@@ -2454,11 +2340,6 @@ def test_parse_chunk_grid_regular_from_dict(self) -> None:
24542340 assert g .get_nchunks () == 100
24552341
24562342
2457- # ---------------------------------------------------------------------------
2458- # Boundary chunk tests
2459- # ---------------------------------------------------------------------------
2460-
2461-
24622343class TestVaryingDimensionBoundary :
24632344 """VaryingDimension with extent < sum(edges), mirroring how FixedDimension
24642345 handles boundary chunks."""
0 commit comments