Skip to content

Commit

Permalink
Add read only zip store
Browse files Browse the repository at this point in the history
  • Loading branch information
LDeakin committed Sep 30, 2023
1 parent a6a4f5c commit 4e00fd4
Show file tree
Hide file tree
Showing 6 changed files with 391 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added
- Read only `ZipStore` behind `zip` feature

### Changed
- Relax some dependency minimum versions
- Add `size_hint()` to some array subset iterators
Expand Down
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "zarrs"
description = "A library for the Zarr V3 storage format for multidimensional arrays and metadata"
version = "0.3.1"
version = "0.4.0"
authors = ["Lachlan Deakin <ljdgit@gmail.com>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -11,7 +11,7 @@ categories = ["encoding"]
exclude = [".dockerignore", ".github", ".editorconfig", "Dockerfile", "coverage.sh", "TODO.md"]

[features]
default = ["transpose", "blosc", "gzip", "sharding", "crc32c", "zstd", "raw_bits", "float16", "bfloat16", "ndarray"]
default = ["transpose", "blosc", "gzip", "sharding", "crc32c", "zstd", "raw_bits", "float16", "bfloat16", "zip", "ndarray"]
# Codecs
transpose = ["dep:ndarray"]
blosc = ["dep:blosc-sys"]
Expand All @@ -23,6 +23,8 @@ zstd = ["dep:zstd"]
raw_bits = []
float16 = ["dep:half"]
bfloat16 = ["dep:half"]
# Stores
zip = ["dep:zip"]
# Utilities
ndarray = ["dep:ndarray"] # Adds ndarray utility functions to Array

Expand All @@ -48,6 +50,7 @@ serde = { version = "1.0.100", features = ["derive"] }
serde_json = { version = "1.0.71", features = ["preserve_order"] }
thiserror = "1.0.7"
walkdir = "2.3.2"
zip = { version = "0.6", optional = true }
zstd = { version = "0.12", optional = true }

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## TODO
- Review documentation
- Increase test coverage
- Additional stores (e.g. zip, http) and URI support [see ZEP0008](https://github.com/zarr-developers/zeps/pull/48)
- Additional stores (e.g. http) and URI support [see ZEP0008](https://github.com/zarr-developers/zeps/pull/48)
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//! - [x] [ZEP0001 - Zarr specification version 3](https://zarr.dev/zeps/draft/ZEP0001.html)
//! - [x] [ZEP0002 - Sharding codec](https://zarr.dev/zeps/draft/ZEP0002.html) ([under review](https://github.com/zarr-developers/zarr-specs/issues/254))
//! - [x] [ZEP0003 - Variable chunking](https://zarr.dev/zeps/draft/ZEP0003.html) ([draft](https://github.com/orgs/zarr-developers/discussions/52))
//! - [x] Stores: [`filesystem`](crate::storage::store::FilesystemStore), [`memory`](crate::storage::store::MemoryStore)
//! - [x] Stores: [`filesystem`](crate::storage::store::FilesystemStore), [`memory`](crate::storage::store::MemoryStore), [`zip`](crate::storage::store::ZipStore)
//! - [x] Data types: [core data types](crate::array::data_type::DataType), [`raw bits`](crate::array::data_type::RawBitsDataType), [`float16`](crate::array::data_type::Float16DataType), [`bfloat16`](crate::array::data_type::Bfloat16DataType) [(spec issue)](https://github.com/zarr-developers/zarr-specs/issues/130)
//! - [x] Chunk grids: [`regular`](crate::array::chunk_grid::RegularChunkGrid), [`rectangular`](crate::array::chunk_grid::RectangularChunkGrid) ([draft](https://github.com/orgs/zarr-developers/discussions/52))
//! - [x] Chunk key encoding: [`default`](crate::array::chunk_key_encoding::DefaultChunkKeyEncoding), [`v2`](crate::array::chunk_key_encoding::V2ChunkKeyEncoding)
Expand Down
11 changes: 9 additions & 2 deletions src/storage/store.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Zarr stores. Includes [filesystem](FilesystemStore) and [memory](MemoryStore) implementations.
//! Zarr stores. Includes [filesystem](FilesystemStore), [memory](MemoryStore), and [zip](ZipStore) (read only) implementations.
//!
//! All stores must be Send + Sync with internally managed synchronisation.
//!
Expand All @@ -10,10 +10,17 @@ mod memory;
mod prefix;
// mod store_plugin;

pub use filesystem::{FilesystemStore, FilesystemStoreCreateError};
pub use key::{StoreKey, StoreKeyError, StoreKeys};
pub use memory::MemoryStore;
pub use prefix::{StorePrefix, StorePrefixError, StorePrefixes};

pub use filesystem::{FilesystemStore, FilesystemStoreCreateError};

#[cfg(feature = "zip")]
mod zip;
#[cfg(feature = "zip")]
pub use zip::{ZipStore, ZipStoreCreateError};

// pub use store_plugin::{StorePlugin, StorePluginCreateError}; // Currently disabled.

use std::sync::Arc;
Expand Down
Loading

0 comments on commit 4e00fd4

Please sign in to comment.