evlib 0.12.0

Event Camera Data Processing Library
Documentation
[package]
name            = "evlib"
version         = "0.12.0"
authors         = ["Tarek Allam <t.allam.jr@gmail.com>"]
edition         = "2021"
resolver        = "2"
description     = "Event Camera Data Processing Library"
readme          = "README.md"
license         = "MIT"
repository      = "https://github.com/tallamjr/evlib"
homepage        = "https://github.com/tallamjr/evlib"
documentation   = "https://docs.rs/evlib"
keywords        = ["event-camera", "vision", "rust", "python", "pyo3"]
categories      = ["science", "multimedia"]
exclude         = [
    "data/**/*",
    "dist/**/*",
    "examples/**/*",
    "python/**/*",
    "tests/**/*",
    "*.png",
    "*.mp4",
]

[lib]
name           = "evlib"
crate-type     = ["cdylib", "rlib"]

# Rust criterion benches live under benchmarks/rust/ (alongside the Python suite in benchmarks/),
# so the repo has a single top-level benchmarks/ folder rather than a separate benches/ dir.
[[bench]]
name = "memory_efficiency"
path = "benchmarks/rust/memory_efficiency.rs"
harness = false

[[bench]]
name = "streaming_performance"
path = "benchmarks/rust/streaming_performance.rs"
harness = false

[[bench]]
name = "format_comparison"
path = "benchmarks/rust/format_comparison.rs"
harness = false

[[bench]]
name = "basic_performance"
path = "benchmarks/rust/basic_performance.rs"
harness = false

[[bench]]
name = "standalone_benchmark"
path = "benchmarks/rust/standalone_benchmark.rs"
harness = false

[dependencies]
# Python bindings (optional)
numpy          = { version = "0.25.0", optional = true }
pyo3           = { version = "0.25.1", optional = true }
pyo3-ffi       = { version = "0.25.1", optional = true }

# Core data processing
ndarray        = "0.15.6"
ndarray-rand   = "0.14.0"
rand           = "=0.8.5"
rand_distr     = "=0.4.3"
fastrand       = "2.0"

# Torch-style tensor ops removed (was causing objc_exception compilation issues on Linux)
# candle-core    = { version = "0.9.1", default-features = false }
# candle-nn      = { version = "0.9.1", default-features = false }

# Polars for efficient event data processing (optional)
polars         = { version = "0.49.1", default-features = true, features = ["temporal", "dtype-u16", "dtype-i8", "lazy"], optional = true }
pyo3-polars    = { version = "0.22.0", optional = true }

# Apache Arrow for zero-copy data transfer (optional)
arrow          = { version = "55.0", default-features = false, optional = true }
arrow-array    = { version = "55.0", optional = true }
pyo3-arrow     = { version = "0.10.1", optional = true }

# I/O & utilities
memmap2        = "0.5"
lazy_static    = "1.4"
byteorder      = "1.5"
# LZ4 frame decompression for AEDAT 4.0 (DV framework) packet bodies
lz4_flex       = { version = "0.11", default-features = false, features = ["frame"] }

# Runtime loader for the nvcc-built CUDA scatter kernel (.so), used by the optional `cuda` backend.
libloading     = { version = "0.8", optional = true }

serde          = { version = "1.0", features = ["derive"] }
serde_json     = "1.0"
num_cpus       = "1.16"
thiserror      = "1.0"
crc32fast      = "1"
tokio          = { version = "1", features = ["net", "io-util", "rt", "macros"] }

# Platform-specific dependencies
# HDF5 and tracing only on Unix (Linux/macOS) - not available on Windows
# HDF5 crates are optional and enabled via the `hdf5` feature flag.
[target.'cfg(unix)'.dependencies]
hdf5-metno     = { version = "0.10.1", features = ["blosc-all"], optional = true }
hdf5-metno-sys = { version = "0.10.1", optional = true }
tracing        = { version = "0.1.40" }
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "fmt", "json"] }

# Metal GPU scatter-add backend (Apple Silicon), opt-in via the `metal` feature. macOS only.
[target.'cfg(target_os = "macos")'.dependencies]
metal          = { version = "0.27", optional = true }
objc           = { version = "0.2", optional = true }

[dev-dependencies]
tempfile       = "3.8"
criterion      = { version = "0.5", features = ["html_reports"] }

[features]
# Default features - automatically platform-aware:
# - Unix (Linux/macOS): Includes all features (HDF5 and tracing available)
# - Windows: Excludes HDF5 and tracing (not in dependencies on Windows)
default        = ["polars", "python", "arrow"]

# Individual feature flags
python         = ["dep:pyo3", "dep:pyo3-ffi", "dep:numpy", "dep:pyo3-polars"]
# Opt-in PyO3 extension-module mode. Required ONLY for distributable wheels
# (manylinux/macOS/Windows) so the .so does not link libpython directly.
# Deliberately NOT in `default`: with it off, pyo3's build script links the
# present libpython, which lets `cargo test` and `maturin develop` build and
# run without any RUSTFLAGS hack.
extension-module = ["pyo3/extension-module"]
# CUDA scatter-add backend: loads an nvcc-built librvt_scatter.so at runtime (no link-time CUDA).
cuda           = ["dep:libloading"]
# Metal scatter-add backend (Apple Silicon): MSL kernel compiled at runtime via metal-rs.
metal          = ["dep:metal", "dep:objc"]
polars         = ["dep:polars"]
arrow          = ["dep:arrow", "dep:arrow-array", "dep:pyo3-arrow"]
zero-copy      = ["arrow"]  # Alias for clarity
# HDF5 support (Unix-only). Opt-in because the hdf5-metno-sys build script
# requires a compatible system HDF5 install. On Windows the underlying deps
# aren't available, so this feature compiles to no-op stubs there.
hdf5           = ["dep:hdf5-metno", "dep:hdf5-metno-sys"]