[package]
name = "hdf5-pure"
version = "0.2.0"
edition = "2024"
license = "MIT"
description = "Pure-Rust HDF5 writer library (WASM-compatible, no C dependencies)"
repository = "https://github.com/stephenberry/hdf5-pure"
build = "build.rs"
# Keep binary test fixtures out of the published crate. They are needed only
# for maintainer CI (byte-level crosscheck against reference HDF5 / H5Z-ZFP
# fixtures) and stay in the git repo for that purpose.
exclude = ["tests/fixtures/**"]

[features]
default = ["std", "checksum", "deflate"]
std = []
checksum = []
fast-checksum = ["crc32fast"]
deflate = ["flate2"]
fast-deflate = ["flate2/zlib-ng"]
provenance = ["sha2"]
mmap = ["memmap2"]
parallel = ["rayon"]
# Pure-Rust ZFP fixed-rate compression filter (HDF5 filter ID 32013).
# Supports f32/f64/i32/i64 datasets in 1D–4D.
zfp = []
# Serde-based (de)serialization of MATLAB v7.3 .mat files.
# Requires `std` (uses File/Group/Dataset reader APIs).
serde = ["dep:serde", "std"]
# Test-only: enable a crosscheck test that links against the system libmatio
# (reference MATLAB MAT file library). Requires libmatio to be installed:
# `brew install libmatio` (macOS) or `apt install libmatio-dev` (Debian).
# Not a run-time dependency — build.rs only emits link directives for this
# feature, and the crosscheck lives in a gated integration test.
matio-crosscheck = ["serde"]

[dependencies]
byteorder = { version = "1", default-features = false }
flate2 = { version = "1", optional = true, default-features = false, features = ["rust_backend"] }
sha2 = { version = "0.10", optional = true, default-features = false }
rayon = { version = "1", optional = true }
crc32fast = { version = "1", optional = true }
memmap2 = { version = "0.9", optional = true }
serde = { version = "1", optional = true, default-features = false, features = ["derive", "alloc"] }

[dev-dependencies]
tempfile = "3"
serde_json = "1"
serde = { version = "1", features = ["derive"] }
hdf5 = { package = "hdf5-metno", version = "0.12", features = ["static", "zlib"] }
ndarray = "0.16"

[[example]]
name = "matlab_fixtures"
required-features = ["serde"]
