use thiserror::Error;
#[derive(Debug, Error)]
pub enum ManifoldsError {
#[error("perplexity ({perplexity}) must be strictly less than the kNN size ({k})")]
PerplexityTooLarge {
perplexity: f64,
k: usize,
},
#[error("tSNE only supports n_dim = 2. Chosen dim = {n_dim}")]
IncorrectDim {
n_dim: usize,
},
#[error("The matrix is not of CSR type. Please double check the inputs")]
SparseMatrixIsNotCsr,
#[error("The dimensions of the matrix do not support sparse multiplication (matrix a n_col: {n_col_a}; matrix b n_row: {n_row_b})")]
SparseMatrixMultiplication {
n_col_a: usize,
n_row_b: usize,
},
#[error("The sparse matrix must be square")]
SpareMatrixMustBeSquare,
#[error("The chosen power must be positive, but is {power}.")]
PowerMustBePositive {
power: usize,
},
#[error("Error from the ann-search-rs crate: {0}")]
AnnSearchRsError(#[from] ann_search_rs::errors::AnnSearchErrors),
#[error("The faer SVD failed - please verify the data")]
FaerSvdError,
#[error("The faer Eigen decomposition failed - please verify the data")]
FaerEigenError,
#[error("The matrix needs to be square")]
NotSquareMatrix,
#[error("Empty data was parsed through - upstream error?")]
NoData,
#[error("UMAP: no edges to optimise - upstream error?")]
NoGraphEdges,
}