3030 "selection" ,
3131 [
3232 (slice (None ), slice (None )), # everything
33- (slice (1 , None ), slice (1 , None )), # top-left chunk is empty
33+ (slice (4 , None ), slice (4 , None )), # top-left chunk is empty
3434 ],
3535)
3636def test_nvcomp_zstd (store : Store , checksum : bool , selection : tuple [slice , slice ]) -> None :
@@ -48,15 +48,16 @@ def test_nvcomp_zstd(store: Store, checksum: bool, selection: tuple[slice, slice
4848 compressors = NvcompZstdCodec (level = 0 , checksum = checksum ),
4949 )
5050
51- a [* selection ] = data
51+ a [* selection ] = data [ * selection ]
5252
5353 if selection == (slice (None ), slice (None )):
5454 cp .testing .assert_array_equal (data [* selection ], a [* selection ])
5555 cp .testing .assert_array_equal (data [:, :], a [:, :])
5656 else :
57+ assert a .nchunks_initialized < a .nchunks
5758 expected = cp .full (data .shape , a .fill_value )
5859 expected [* selection ] = data [* selection ]
59- cp .testing .assert_array_equal (expected , a )
60+ cp .testing .assert_array_equal (expected [ * selection ] , a [ * selection ] )
6061 cp .testing .assert_array_equal (expected [:, :], a [:, :])
6162
6263
0 commit comments