Skip to content

Commit

Permalink
Generate some additional test data
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Oct 3, 2023
1 parent dac74a1 commit 7e3f37e
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/array_write_read.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[cfg(feature = "ndarray")]
fn array_write_read() -> Result<(), Box<dyn std::error::Error>> {
use rayon::prelude::{IntoParallelIterator, ParallelIterator};
use std::sync::Arc;
use zarrs::{
array::{chunk_grid::ChunkGridTraits, DataType},
array::{codec, FillValue},
Expand All @@ -12,7 +13,8 @@ fn array_write_read() -> Result<(), Box<dyn std::error::Error>> {
// 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";
Expand Down
1 change: 1 addition & 0 deletions examples/sharded_array_write_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fn sharded_array_write_read() -> Result<(), Box<dyn std::error::Error>> {
// 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
Expand Down
Binary file added tests/data/array_write_read.zarr/group/array/c/0/0
Binary file not shown.
Binary file added tests/data/array_write_read.zarr/group/array/c/0/1
Binary file not shown.
Binary file added tests/data/array_write_read.zarr/group/array/c/1/0
Binary file not shown.
Binary file added tests/data/array_write_read.zarr/group/array/c/1/1
Binary file not shown.
43 changes: 43 additions & 0 deletions tests/data/array_write_read.zarr/group/array/zarr.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
7 changes: 7 additions & 0 deletions tests/data/array_write_read.zarr/group/zarr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"node_type": "group",
"zarr_format": 3,
"attributes": {
"foo": "bar"
}
}
Binary file not shown.
Binary file not shown.
66 changes: 66 additions & 0 deletions tests/data/sharded_array_write_read.zarr/group/array/zarr.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
7 changes: 7 additions & 0 deletions tests/data/sharded_array_write_read.zarr/group/zarr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"node_type": "group",
"zarr_format": 3,
"attributes": {
"foo": "bar"
}
}

0 comments on commit 7e3f37e

Please sign in to comment.