use scirs2_core::error::CoreError;
use scirs2_linalg::error::LinalgError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ClusteringError {
#[error("Invalid input: {0}")]
InvalidInput(String),
#[error("Computation error: {0}")]
ComputationError(String),
#[error("Vector quantization error: {0}")]
VqError(String),
#[error("Hierarchical clustering error: {0}")]
HierarchyError(String),
#[error("Empty cluster error: {0}")]
EmptyCluster(String),
#[error("Invalid state: {0}")]
InvalidState(String),
#[error("Linear algebra error: {0}")]
LinalgError(#[from] LinalgError),
#[error("Core validation error: {0}")]
CoreError(#[from] CoreError),
#[error("I/O error: {0}")]
IoError(#[from] std::io::Error),
#[error("JSON error: {0}")]
JsonError(#[from] serde_json::Error),
#[error("Error: {0}")]
Other(String),
}
pub type Result<T> = std::result::Result<T, ClusteringError>;