@@ -168,16 +168,15 @@ def test_basic(self) -> None:
168168 # chunk_size is always uniform (codec buffer)
169169 assert d .chunk_size (0 ) == 10
170170 assert d .chunk_size (9 ) == 10
171- # data_size clips at boundary
172171 assert d .data_size (0 ) == 10
173172 assert d .data_size (9 ) == 10
174173 assert d .nchunks == 10
175174
176175 def test_boundary_data_size (self ) -> None :
177176 d = FixedDimension (size = 10 , extent = 95 )
178177 assert d .nchunks == 10
179- assert d .chunk_size (9 ) == 10 # codec buffer always full
180- assert d .data_size (9 ) == 5 # only 5 valid elements at boundary
178+ assert d .chunk_size (9 ) == 10
179+ assert d .data_size (9 ) == 5
181180
182181 def test_vectorized (self ) -> None :
183182 d = FixedDimension (size = 10 , extent = 100 )
@@ -196,7 +195,7 @@ def test_negative_extent_rejected(self) -> None:
196195 def test_zero_size_allowed (self ) -> None :
197196 d = FixedDimension (size = 0 , extent = 0 )
198197 assert d .size == 0
199- assert d .nchunks == 0 # zero-sized chunks can't hold data
198+ assert d .nchunks == 0
200199
201200 # FixedDimension.chunk_offset/chunk_size/data_size do not bounds-check
202201 # for performance (callers validate). OOB access is tested via
@@ -234,7 +233,6 @@ def test_chunk_size(self) -> None:
234233
235234 def test_data_size (self ) -> None :
236235 d = VaryingDimension ([10 , 20 , 30 ], extent = 60 )
237- # data_size == chunk_size when extent == sum(edges) (no boundary)
238236 assert d .data_size (0 ) == 10
239237 assert d .data_size (1 ) == 20
240238 assert d .data_size (2 ) == 30
@@ -313,7 +311,7 @@ def test_regular_shape(self) -> None:
313311
314312 def test_regular_shape_boundary (self ) -> None :
315313 g = ChunkGrid .from_regular ((95 , 200 ), (10 , 20 ))
316- assert g .grid_shape == (10 , 10 ) # ceildiv(95, 10) == 10
314+ assert g .grid_shape == (10 , 10 )
317315
318316 def test_rectilinear_shape (self ) -> None :
319317 g = ChunkGrid .from_rectilinear ([[10 , 20 , 30 ], [25 , 25 , 25 , 25 ]], array_shape = (60 , 100 ))
@@ -2347,29 +2345,28 @@ class TestVaryingDimensionBoundary:
23472345 def test_extent_parameter (self ) -> None :
23482346 d = VaryingDimension ([10 , 20 , 30 ], extent = 50 )
23492347 assert d .extent == 50
2350- assert d .chunk_size (2 ) == 30 # codec buffer: full edge
2351- assert d .data_size (2 ) == 20 # valid data: clipped to extent
2348+ assert d .chunk_size (2 ) == 30
2349+ assert d .data_size (2 ) == 20
23522350
23532351 def test_extent_equals_sum_no_clipping (self ) -> None :
23542352 d = VaryingDimension ([10 , 20 , 30 ], extent = 60 )
23552353 assert d .extent == 60
2356- assert d .data_size (2 ) == 30 # no clipping when extent == sum(edges)
2354+ assert d .data_size (2 ) == 30
23572355
23582356 def test_data_size_interior_chunks_unaffected (self ) -> None :
23592357 d = VaryingDimension ([10 , 20 , 30 ], extent = 50 )
2360- assert d .data_size (0 ) == 10 # fully within extent
2361- assert d .data_size (1 ) == 20 # fully within extent (offset 10, ends at 30)
2358+ assert d .data_size (0 ) == 10
2359+ assert d .data_size (1 ) == 20
23622360
23632361 def test_data_size_at_exact_boundary (self ) -> None :
23642362 d = VaryingDimension ([10 , 20 , 30 ], extent = 60 )
2365- # extent == sum(edges), so no clipping
23662363 assert d .data_size (2 ) == 30
23672364
23682365 def test_data_size_single_element_boundary (self ) -> None :
23692366 d = VaryingDimension ([10 , 20 , 30 ], extent = 31 )
23702367 assert d .data_size (0 ) == 10
23712368 assert d .data_size (1 ) == 20
2372- assert d .data_size (2 ) == 1 # only 1 element in last chunk
2369+ assert d .data_size (2 ) == 1
23732370
23742371 def test_extent_exceeds_sum_rejected (self ) -> None :
23752372 with pytest .raises (ValueError , match = "exceeds sum of edges" ):
@@ -2384,8 +2381,8 @@ def test_chunk_spec_boundary_varying(self) -> None:
23842381 g = ChunkGrid (dimensions = (VaryingDimension ([10 , 20 , 30 ], extent = 50 ),))
23852382 spec = g [(2 ,)]
23862383 assert spec is not None
2387- assert spec .codec_shape == (30 ,) # full edge
2388- assert spec .shape == (20 ,) # clipped to extent
2384+ assert spec .codec_shape == (30 ,)
2385+ assert spec .shape == (20 ,)
23892386 assert spec .is_boundary is True
23902387
23912388 def test_chunk_spec_interior_varying (self ) -> None :
@@ -2404,12 +2401,12 @@ def test_multiple_chunks_past_extent(self) -> None:
24042401 """Edges past extent are structural; nchunks counts active only."""
24052402 g = ChunkGrid .from_rectilinear ([[10 , 20 , 30 , 40 ]], array_shape = (50 ,))
24062403 d = g .dimensions [0 ]
2407- assert d .ngridcells == 4 # structural: all edges
2408- assert d .nchunks == 3 # active: chunks overlapping [0, 50)
2409- assert d .data_size (0 ) == 10 # fully within
2410- assert d .data_size (1 ) == 20 # fully within
2411- assert d .data_size (2 ) == 20 # partial: 50 - 30 = 20
2412- assert d .chunk_size (2 ) == 30 # codec buffer: full edge
2404+ assert d .ngridcells == 4
2405+ assert d .nchunks == 3
2406+ assert d .data_size (0 ) == 10
2407+ assert d .data_size (1 ) == 20
2408+ assert d .data_size (2 ) == 20
2409+ assert d .chunk_size (2 ) == 30
24132410
24142411 def test_chunk_spec_past_extent_is_oob (self ) -> None :
24152412 """Chunk entirely past the extent is out of bounds (not active)."""
0 commit comments