From 7e3f37e32a025ba429f2d30bdfaa83fbb1b6c44a Mon Sep 17 00:00:00 2001 From: Lachlan Deakin Date: Wed, 4 Oct 2023 08:41:43 +1100 Subject: [PATCH] Generate some additional test data --- examples/array_write_read.rs | 4 +- examples/sharded_array_write_read.rs | 1 + .../array_write_read.zarr/group/array/c/0/0 | Bin 0 -> 37 bytes .../array_write_read.zarr/group/array/c/0/1 | Bin 0 -> 58 bytes .../array_write_read.zarr/group/array/c/1/0 | Bin 0 -> 49 bytes .../array_write_read.zarr/group/array/c/1/1 | Bin 0 -> 63 bytes .../group/array/zarr.json | 43 ++++++++++++ .../array_write_read.zarr/group/zarr.json | 7 ++ .../group/array/c/0/0 | Bin 0 -> 140 bytes .../group/array/c/1/0 | Bin 0 -> 140 bytes .../group/array/zarr.json | 66 ++++++++++++++++++ .../group/zarr.json | 7 ++ 12 files changed, 127 insertions(+), 1 deletion(-) create mode 100644 tests/data/array_write_read.zarr/group/array/c/0/0 create mode 100644 tests/data/array_write_read.zarr/group/array/c/0/1 create mode 100644 tests/data/array_write_read.zarr/group/array/c/1/0 create mode 100644 tests/data/array_write_read.zarr/group/array/c/1/1 create mode 100644 tests/data/array_write_read.zarr/group/array/zarr.json create mode 100644 tests/data/array_write_read.zarr/group/zarr.json create mode 100644 tests/data/sharded_array_write_read.zarr/group/array/c/0/0 create mode 100644 tests/data/sharded_array_write_read.zarr/group/array/c/1/0 create mode 100644 tests/data/sharded_array_write_read.zarr/group/array/zarr.json create mode 100644 tests/data/sharded_array_write_read.zarr/group/zarr.json diff --git a/examples/array_write_read.rs b/examples/array_write_read.rs index adad8508..c8f6d2ea 100644 --- a/examples/array_write_read.rs +++ b/examples/array_write_read.rs @@ -1,6 +1,7 @@ #[cfg(feature = "ndarray")] fn array_write_read() -> Result<(), Box> { use rayon::prelude::{IntoParallelIterator, ParallelIterator}; + use std::sync::Arc; use zarrs::{ array::{chunk_grid::ChunkGridTraits, DataType}, array::{codec, FillValue}, @@ -12,7 +13,8 @@ fn array_write_read() -> Result<(), Box> { // Create a store // let path = tempfile::TempDir::new()?; // let store = Arc::new(store::FilesystemStore::new(path.path())?); - let store = std::sync::Arc::new(store::MemoryStore::default()); + // let store = Arc::new(store::FilesystemStore::new("tests/data/array_write_read.zarr")?); + let store = Arc::new(store::MemoryStore::default()); // Create a group and write metadata to filesystem let group_path = "/group"; diff --git a/examples/sharded_array_write_read.rs b/examples/sharded_array_write_read.rs index a510a7ff..2c2ddddd 100644 --- a/examples/sharded_array_write_read.rs +++ b/examples/sharded_array_write_read.rs @@ -16,6 +16,7 @@ fn sharded_array_write_read() -> Result<(), Box> { // Create a store // let path = tempfile::TempDir::new()?; // let store = Arc::new(store::FilesystemStore::new(path.path())?); + // let store = Arc::new(store::FilesystemStore::new("tests/data/sharded_array_write_read.zarr")?); let store = Arc::new(store::MemoryStore::default()); // Create a group and write metadata to filesystem diff --git a/tests/data/array_write_read.zarr/group/array/c/0/0 b/tests/data/array_write_read.zarr/group/array/c/0/0 new file mode 100644 index 0000000000000000000000000000000000000000..f9f7ec651553a1cbb7a74eed2760ec4f38a7298e GIT binary patch literal 37 ncmb2|=3oGW|8ox*G6Gpm23){);o(Z2cQ@L(vl3J literal 0 HcmV?d00001 diff --git a/tests/data/array_write_read.zarr/group/array/c/0/1 b/tests/data/array_write_read.zarr/group/array/c/0/1 new file mode 100644 index 0000000000000000000000000000000000000000..23151f6f7b83ffeefe890d4942161750bff4e643 GIT binary patch literal 58 zcmb2|=3oGW|E0$_@-hUlxL!1$`RIDRda*$-V}!fz#0#2vMf?dpdh*}$+v|e_rNn#r Kyl*%FwEzGq9un~Y literal 0 HcmV?d00001 diff --git a/tests/data/array_write_read.zarr/group/array/c/1/0 b/tests/data/array_write_read.zarr/group/array/c/1/0 new file mode 100644 index 0000000000000000000000000000000000000000..e4b84363b3c24322c011972bb918ea6f624764b8 GIT binary patch literal 49 zcmb2|=3oGW|GCE(GBPl5Fd5V>I-M=oVIRrEa`;e#*tr|67M@S-xlNzuS~vhz0svsr B4_g2L literal 0 HcmV?d00001 diff --git a/tests/data/array_write_read.zarr/group/array/c/1/1 b/tests/data/array_write_read.zarr/group/array/c/1/1 new file mode 100644 index 0000000000000000000000000000000000000000..124fc7f4025dec1ab03f5241a88921ee17809523 GIT binary patch literal 63 zcmb2|=3oGW|GvjJ3Ni=?xE{RTmX+tWrtdymZopYl2kRt3y&DOP(zcRsc;c?>sJ;BV PJ6}$=&)$yN0jLiEjjj~M literal 0 HcmV?d00001 diff --git a/tests/data/array_write_read.zarr/group/array/zarr.json b/tests/data/array_write_read.zarr/group/array/zarr.json new file mode 100644 index 00000000..f5f64fce --- /dev/null +++ b/tests/data/array_write_read.zarr/group/array/zarr.json @@ -0,0 +1,43 @@ +{ + "node_type": "array", + "zarr_format": 3, + "shape": [ + 8, + 8 + ], + "data_type": "float32", + "chunk_grid": { + "name": "regular", + "configuration": { + "chunk_shape": [ + 4, + 4 + ] + } + }, + "chunk_key_encoding": { + "name": "default", + "configuration": { + "separator": "/" + } + }, + "fill_value": "NaN", + "codecs": [ + { + "name": "bytes", + "configuration": { + "endian": "little" + } + }, + { + "name": "gzip", + "configuration": { + "level": 5 + } + } + ], + "dimension_names": [ + "y", + "x" + ] +} \ No newline at end of file diff --git a/tests/data/array_write_read.zarr/group/zarr.json b/tests/data/array_write_read.zarr/group/zarr.json new file mode 100644 index 00000000..6d5d2393 --- /dev/null +++ b/tests/data/array_write_read.zarr/group/zarr.json @@ -0,0 +1,7 @@ +{ + "node_type": "group", + "zarr_format": 3, + "attributes": { + "foo": "bar" + } +} \ No newline at end of file diff --git a/tests/data/sharded_array_write_read.zarr/group/array/c/0/0 b/tests/data/sharded_array_write_read.zarr/group/array/c/0/0 new file mode 100644 index 0000000000000000000000000000000000000000..b770365fd7cc933880141829619b3deb0bdd7774 GIT binary patch literal 140 zcmZ9Ds}Y1i5Cun`oCw&B07We5w>$fh1cI3yhy+E|dHh(S;DF+aD%!j!y50Dpi(P<( zh+?p0(F%hTM=lCY8nqB@)6)7wc25(KA*dECn^@(*nT4wc%_>@n2LGMU=1+H@_x6oj Ee_JahxBvhE literal 0 HcmV?d00001 diff --git a/tests/data/sharded_array_write_read.zarr/group/array/c/1/0 b/tests/data/sharded_array_write_read.zarr/group/array/c/1/0 new file mode 100644 index 0000000000000000000000000000000000000000..8c8df8da0bed2fb261e72907c42ec7830754fe87 GIT binary patch literal 140 zcmZ9DD-M7_3OkyPnO9I&Dv8_(oe2t?>p0YZP>NTUoh#s>ziQ**#3^gxT^U^%$zkO-e E18kEf00000 literal 0 HcmV?d00001 diff --git a/tests/data/sharded_array_write_read.zarr/group/array/zarr.json b/tests/data/sharded_array_write_read.zarr/group/array/zarr.json new file mode 100644 index 00000000..36654614 --- /dev/null +++ b/tests/data/sharded_array_write_read.zarr/group/array/zarr.json @@ -0,0 +1,66 @@ +{ + "node_type": "array", + "zarr_format": 3, + "shape": [ + 8, + 8 + ], + "data_type": "uint16", + "chunk_grid": { + "name": "regular", + "configuration": { + "chunk_shape": [ + 4, + 8 + ] + } + }, + "chunk_key_encoding": { + "name": "default", + "configuration": { + "separator": "/" + } + }, + "fill_value": 0, + "codecs": [ + { + "name": "sharding_indexed", + "configuration": { + "chunk_shape": [ + 4, + 4 + ], + "codecs": [ + { + "name": "bytes", + "configuration": { + "endian": "little" + } + }, + { + "name": "gzip", + "configuration": { + "level": 5 + } + } + ], + "index_codecs": [ + { + "name": "bytes", + "configuration": { + "endian": "little" + } + }, + { + "name": "crc32c", + "configuration": {} + } + ] + } + } + ], + "dimension_names": [ + "y", + "x" + ] +} \ No newline at end of file diff --git a/tests/data/sharded_array_write_read.zarr/group/zarr.json b/tests/data/sharded_array_write_read.zarr/group/zarr.json new file mode 100644 index 00000000..6d5d2393 --- /dev/null +++ b/tests/data/sharded_array_write_read.zarr/group/zarr.json @@ -0,0 +1,7 @@ +{ + "node_type": "group", + "zarr_format": 3, + "attributes": { + "foo": "bar" + } +} \ No newline at end of file