@@ -598,15 +598,15 @@ def pack_tensor(tensor, chunksize=None, **kwargs):
598598 arr = np .asarray (tensor )
599599 # If not passed, set a sensible typesize
600600 if 'cparams' in kwargs and 'typesize' not in kwargs ['cparams' ]:
601- cparams = kwargs .pop ('cparams' )
602- cparams = cparams .copy ()
601+ cparams = kwargs .pop ('cparams' ).copy ()
603602 cparams ['typesize' ] = arr .itemsize
604603 kwargs ['cparams' ] = cparams
605604 elif 'typesize' not in kwargs :
606605 kwargs ['typesize' ] = arr .itemsize
607606
608607 urlpath = kwargs .get ('urlpath' , None )
609- contiguous = False if urlpath is None else True
608+ if 'contiguous' not in kwargs :
609+ kwargs ['contiguous' ] = False if urlpath is None else True
610610
611611 if chunksize is None :
612612 chunksize = arr .size * arr .itemsize
@@ -615,7 +615,7 @@ def pack_tensor(tensor, chunksize=None, **kwargs):
615615 chunksize = 2 ** 28
616616 # Make that a multiple of typesize
617617 chunksize = chunksize // arr .itemsize * arr .itemsize
618- schunk = blosc2 .SChunk (chunksize = chunksize , contiguous = contiguous , data = arr , ** kwargs )
618+ schunk = blosc2 .SChunk (chunksize = chunksize , data = arr , ** kwargs )
619619 # Guess the kind of tensor / array
620620 repr_tensor = repr (tensor )
621621 if "tensor" in repr_tensor :
0 commit comments