Skip to content

Commit

Permalink
Start sharding
Browse files Browse the repository at this point in the history
  • Loading branch information
grimbough committed Aug 14, 2023
1 parent a2a9fdf commit 5ef1b5d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/read_data_v3.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ read_chunk_v3 <- function(zarr_array_path, chunk_id, metadata, s3_client = NULL,
chunk <- blosc_codec(chunk, cname = config$cname,
clevel = config$clevel, shuffle = config$shuffle,
encoding = FALSE)
} else if (codec_name == "sharding_indexed") {

} else {
stop("Unsupported codec: ", codec_name)
}
Expand Down
Empty file added R/sharding.R
Empty file.
26 changes: 26 additions & 0 deletions inst/scripts/create_test_data_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,29 @@
],
)
a[:] = data

###################

shape = (10,)
dtype = 'int8'

data = np.full(shape, 0, dtype=dtype)
data[:] = np.arange(start=1, stop=11)
path = "sharded/1d-sub-chunks.zarr"
shutil.rmtree(os.path.join(data_store, path), ignore_errors=True)
a = zarrita.Array.create(
store / path,
shape=shape,
dtype=dtype,
chunk_shape=(10,),
codecs=[
zarrita.codecs.sharding_codec(
chunk_shape=(5,),
codecs=[
zarrita.codecs.endian_codec(),
zarrita.codecs.gzip_codec()
],
)
],
)
a[:] = data

0 comments on commit 5ef1b5d

Please sign in to comment.