@@ -129,7 +129,7 @@ def get_chunk_slice(self, chunk_coords: ChunkCoords) -> tuple[int, int] | None:
129
129
if (chunk_start , chunk_len ) == (MAX_UINT_64 , MAX_UINT_64 ):
130
130
return None
131
131
else :
132
- return (int (chunk_start ), int (chunk_len ))
132
+ return (int (chunk_start ), int (chunk_start + chunk_len ))
133
133
134
134
def set_chunk_slice (self , chunk_coords : ChunkCoords , chunk_slice : slice | None ) -> None :
135
135
localized_chunk = self ._localize_chunk (chunk_coords )
@@ -203,7 +203,7 @@ def create_empty(
203
203
def __getitem__ (self , chunk_coords : ChunkCoords ) -> Buffer :
204
204
chunk_byte_slice = self .index .get_chunk_slice (chunk_coords )
205
205
if chunk_byte_slice :
206
- return self .buf [chunk_byte_slice [0 ] : ( chunk_byte_slice [0 ] + chunk_byte_slice [ 1 ]) ]
206
+ return self .buf [chunk_byte_slice [0 ] : chunk_byte_slice [1 ] ]
207
207
raise KeyError
208
208
209
209
def __len__ (self ) -> int :
@@ -700,7 +700,7 @@ async def _load_shard_index_maybe(
700
700
)
701
701
else :
702
702
index_bytes = await byte_getter .get (
703
- prototype = numpy_buffer_prototype (), byte_range = ( - shard_index_size , None )
703
+ prototype = numpy_buffer_prototype (), byte_range = { "suffix" : shard_index_size }
704
704
)
705
705
if index_bytes is not None :
706
706
return await self ._decode_shard_index (index_bytes , chunks_per_shard )
0 commit comments