[package]
name = "scirs2-cluster"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "Clustering algorithms module for SciRS2 (scirs2-cluster)"
readme = "README.md"
license.workspace = true
repository.workspace = true
keywords = ["clustering", "scientific", "scipy", "numerical", "kmeans"]
categories = ["science", "mathematics", "algorithms"]

[lints]
workspace = true
[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]


[dependencies]
# Core dependencies - ALL numeric/array/random functionality from scirs2-core (SciRS2 POLICY)
scirs2-core = { workspace = true, features = ["parallel", "simd", "array", "random"] }
scirs2-spatial = { workspace = true }
scirs2-linalg = { workspace = true }
# scirs2-stats = { workspace = true } # Temporarily disabled due to compilation errors
statrs = { workspace = true }
thiserror = { workspace = true }
approx = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
oxicode = { workspace = true }  # Binary serialization (SIMD-optimized)
flate2 = { workspace = true }
chrono = { workspace = true }
num_cpus = { workspace = true }

# Optional serialization formats
serde_yaml = { workspace = true, optional = true }
rmp-serde = { workspace = true, optional = true }
ciborium = { workspace = true, optional = true }

# Optional compression algorithms
lz4 = { workspace = true, optional = true }
zstd = { workspace = true, optional = true }
bzip2 = { workspace = true, optional = true }

# Temporary file handling
tempfile = { workspace = true }

# Archive handling for batch operations
tar = { workspace = true }

# UUID generation for model versioning
uuid = { workspace = true }

# Optional Python bindings
pyo3 = { workspace = true, optional = true }
numpy = { workspace = true, optional = true }

# Optional visualization libraries
plotters = { workspace = true, optional = true }
egui = { workspace = true, optional = true }
eframe = { workspace = true, optional = true }

[dev-dependencies]
proptest = { workspace = true }
criterion = { workspace = true, features = ["html_reports"] }

[features]
default = ["json", "binary"]
json = []
binary = []
yaml = ["serde_yaml"]
msgpack = ["rmp-serde"]
cbor = ["ciborium"]
all_formats = ["yaml", "msgpack", "cbor"]

# Compression features
lz4_compression = ["lz4"]
zstd_compression = ["zstd"]
bzip2_compression = ["bzip2"]
all_compression = ["lz4_compression", "zstd_compression", "bzip2_compression"]

# SIMD acceleration for clustering operations
simd = ["scirs2-core/simd"]

# GPU acceleration features
gpu = []
cuda = ["gpu"]
opencl = ["gpu"]
rocm = ["gpu"]
metal = ["gpu"]
oneapi = ["gpu"]
gpu_all = ["cuda", "opencl", "rocm", "metal", "oneapi"]

# Python interoperability via scirs2-core conversion utilities
python = ["scirs2-core/python"]

# Visualization features
plotters = ["dep:plotters"]
egui = ["dep:egui", "dep:eframe"]
visualization = ["plotters", "egui"]

[[bench]]
name = "clustering_benchmarks"
harness = false

