@@ -244,7 +244,9 @@ async def from_bytes(
244244
245245 @classmethod
246246 def create_empty (
247- cls , chunks_per_shard : tuple [int , ...], buffer_prototype : BufferPrototype | None = None
247+ cls ,
248+ chunks_per_shard : tuple [int , ...],
249+ buffer_prototype : BufferPrototype | None = None ,
248250 ) -> _ShardReader :
249251 if buffer_prototype is None :
250252 buffer_prototype = default_buffer_prototype ()
@@ -297,7 +299,9 @@ def to_dict_vectorized(
297299
298300@dataclass (frozen = True )
299301class ShardingCodec (
300- ArrayBytesCodec , ArrayBytesCodecPartialDecodeMixin , ArrayBytesCodecPartialEncodeMixin
302+ ArrayBytesCodec ,
303+ ArrayBytesCodecPartialDecodeMixin ,
304+ ArrayBytesCodecPartialEncodeMixin ,
301305):
302306 """Sharding codec"""
303307
@@ -312,7 +316,7 @@ def __init__(
312316 chunk_shape : ShapeLike ,
313317 codecs : Iterable [Codec | dict [str , JSON ]] = (BytesCodec (),),
314318 index_codecs : Iterable [Codec | dict [str , JSON ]] = (BytesCodec (), Crc32cCodec ()),
315- index_location : ShardingCodecIndexLocation | str = ShardingCodecIndexLocation .end ,
319+ index_location : ( ShardingCodecIndexLocation | str ) = ShardingCodecIndexLocation .end ,
316320 ) -> None :
317321 chunk_shape_parsed = parse_shapelike (chunk_shape )
318322 codecs_parsed = parse_codecs (codecs )
@@ -585,7 +589,9 @@ async def _encode_partial_single(
585589
586590 indexer = list (
587591 get_indexer (
588- selection , shape = shard_shape , chunk_grid = RegularChunkGrid (chunk_shape = chunk_shape )
592+ selection ,
593+ shape = shard_shape ,
594+ chunk_grid = RegularChunkGrid (chunk_shape = chunk_shape ),
589595 )
590596 )
591597
@@ -701,7 +707,8 @@ def _shard_index_size(self, chunks_per_shard: tuple[int, ...]) -> int:
701707 get_pipeline_class ()
702708 .from_codecs (self .index_codecs )
703709 .compute_encoded_size (
704- 16 * product (chunks_per_shard ), self ._get_index_chunk_spec (chunks_per_shard )
710+ 16 * product (chunks_per_shard ),
711+ self ._get_index_chunk_spec (chunks_per_shard ),
705712 )
706713 )
707714
@@ -746,7 +753,8 @@ async def _load_shard_index_maybe(
746753 )
747754 else :
748755 index_bytes = await byte_getter .get (
749- prototype = numpy_buffer_prototype (), byte_range = SuffixByteRequest (shard_index_size )
756+ prototype = numpy_buffer_prototype (),
757+ byte_range = SuffixByteRequest (shard_index_size ),
750758 )
751759 if index_bytes is not None :
752760 return await self ._decode_shard_index (index_bytes , chunks_per_shard )
@@ -760,7 +768,10 @@ async def _load_shard_index(
760768 ) or _ShardIndex .create_empty (chunks_per_shard )
761769
762770 async def _load_full_shard_maybe (
763- self , byte_getter : ByteGetter , prototype : BufferPrototype , chunks_per_shard : tuple [int , ...]
771+ self ,
772+ byte_getter : ByteGetter ,
773+ prototype : BufferPrototype ,
774+ chunks_per_shard : tuple [int , ...],
764775 ) -> _ShardReader | None :
765776 shard_bytes = await byte_getter .get (prototype = prototype )
766777
0 commit comments