pub enum CoreErrors {
Show 43 variants
InvalidArgument(String),
MustBePositive(String),
FaerSvdError(String),
FaerEigenError,
FaerCholeskyError(LltError),
PcaAllMissing {
axis: &'static str,
index: usize,
},
PcaTooManyComponents {
n_pcs: usize,
max: usize,
},
BandwidthTooFewPoints {
found: usize,
},
BandwidthTooSparse {
stage: &'static str,
},
BandwidthNoBracket,
LengthMismatch {
name: &'static str,
expected: usize,
found: usize,
},
GpEmptyInput {
name: &'static str,
},
GpDimensionMismatch {
n_x: usize,
n_y: usize,
},
GpInvalidHyperparameter {
name: &'static str,
value: f64,
},
GpNonFiniteInput {
name: &'static str,
},
GpLandmarkCholeskyFailed {
jitter: f64,
n_landmarks: usize,
},
GpPosteriorCholeskyFailed,
GpDegenerateLandmarks,
GpAllWeightsZero,
LinkageNonFiniteDistance {
index: usize,
},
BetaDistribution(String),
AnnSearchRsError(AnnSearchErrors),
DistanceNotSupported(Dist),
NonMatchingFeatureDim {
dim_x: usize,
dim_y: usize,
},
NumberLabelsNotEqualSampleNumber {
label_length: usize,
n_samples: usize,
},
ReferenceOutOfRange,
Data2NotAvailable,
SliceIndexOutOfBounds {
index: usize,
len: usize,
},
DuplicateSliceIndex(usize),
SparseMatrixMultiplication {
n_col_a: usize,
n_row_b: usize,
},
DimensionMisMatchSparse {
indices_len: usize,
data_len: usize,
},
SparseIndptrInvalid {
detail: &'static str,
expected: usize,
got: usize,
},
ShapeMismatchSparse,
SparseMatrixMustBeCsr,
SparseMatrixIsolatedRow {
row: usize,
row_sum: f64,
},
MalformedCsr(&'static str),
SparseMatrixMustBeCsc,
ShapeMismatch {
expected: (usize, usize),
got: (usize, usize),
},
SparseLayoutMismatch {
expected: CompressedSparseFormat,
got: CompressedSparseFormat,
},
NotSerialised(&'static str),
SerialisedVersionMismatch {
found: u32,
supported: u32,
},
SerialisedWidthMismatch {
expected: [u8; 2],
found: [u8; 2],
},
SerialisationFailed(String),
}Expand description
Error variants raised by bixverse-core.
Grouped by subsystem.
Variants§
InvalidArgument(String)
General error for invalid arguments to a given function
MustBePositive(String)
Error for wrong integer parameters
FaerSvdError(String)
SVD from faer failed to converge or returned no solution.
Typically caused by ill-conditioned or degenerate input (e.g. all-zero rows, NaNs, rank-deficient matrices beyond the requested rank).
FaerEigenError
Eigen decomposition from faer failed.
Usually indicates a non-symmetric matrix being passed to a symmetric solver, or numerical breakdown on degenerate input.
FaerCholeskyError(LltError)
Cholesky decomposition from faer failed.
PcaAllMissing
A row or column of the input to PPCA / BPCA holds no observed value.
Fields
PcaTooManyComponents
More components were requested than the data can hold.
BandwidthTooFewPoints
A kernel bandwidth was requested for fewer than two points.
BandwidthTooSparse
A Sheather-Jones pilot functional came back non-finite or non-positive.
R raises “sample is too sparse to find TD” / “… alph2” here. It means the pair-distance counts carry too little signal for the pilot estimate, which in practice is a degenerate or near-constant sample.
BandwidthNoBracket
The Sheather-Jones bracket search never enclosed a root.
LengthMismatch
Two vectors that had to agree in length did not.
Fields
GpEmptyInput
A Gaussian process was handed empty training data.
GpDimensionMismatch
The training inputs and responses disagree in length.
GpInvalidHyperparameter
A hyperparameter is outside its supported range.
Fields
GpNonFiniteInput
A non-finite value reached the fit.
Checked up front because a NaN otherwise surfaces as an unexplained
Cholesky failure much later, with nothing pointing back at the input.
GpLandmarkCholeskyFailed
The landmark Gram matrix stayed singular through the whole jitter ladder.
GpPosteriorCholeskyFailed
The posterior Cholesky failed.
Distinct from [BixverseErrors::GpLandmarkCholeskyFailed] because this
factorises A A^T / sigma^2 + I, whose smallest eigenvalue is at least
one in exact arithmetic. A failure here means a non-finite value got
through the input checks, not that the problem is ill-conditioned.
GpDegenerateLandmarks
Every landmark sits at the same coordinate.
GpAllWeightsZero
Every sample weight is zero.
A zero weight drops its observation, so this leaves the fit with no data and returns the prior everywhere. Indistinguishable from a genuinely flat response, hence an error rather than a silent zero curve.
LinkageNonFiniteDistance
A condensed distance matrix holds a NaN or infinite entry.
BetaDistribution(String)
Beta distribution construction failed
AnnSearchRsError(AnnSearchErrors)
Propagate errors from the ann-search-rs crate
DistanceNotSupported(Dist)
Distance type not supported
NonMatchingFeatureDim
Error if the feature dimensions are not the same
NumberLabelsNotEqualSampleNumber
Label length and number of cells do not match for Harmony
ReferenceOutOfRange
If the reference is out of range
Data2NotAvailable
Error in situations were data_2 in crate::prelude::CompressedSparseData2
is asked for but not available
SliceIndexOutOfBounds
Error if the slice index is out of bounds
DuplicateSliceIndex(usize)
Error if the slice index is duplicated
SparseMatrixMultiplication
Error for sparse multiplication dimension mismatches
DimensionMisMatchSparse
Dimension mismatch error during construction
SparseIndptrInvalid
Error if the indptr of a crate::prelude::CompressedSparseData2 is
inconsistent with the shape it declares or with the stored values.
Raised by crate::prelude::CompressedSparseData2::validate on input
that crossed an FFI boundary, where the struct’s public fields could
have been populated with anything.
Fields
ShapeMismatchSparse
Error if there is a dimension mismatch in terms of the two matrices
SparseMatrixMustBeCsr
Error if the crate::prelude::CompressedSparseData2 is not in CSR.
SparseMatrixIsolatedRow
A row summed to (effectively) zero where a row-stochastic normalisation was asked for.
On a kNN-derived affinity matrix every node has k out-edges, so a zero
row means the kernel weights underflowed rather than that the graph is
legitimately disconnected. Anything built on top of the operator would
be meaningless, hence an error rather than leaving the row at zero.
MalformedCsr(&'static str)
A CSR matrix failed one of its structural invariants.
Raised by crate::core::math::sparse::validate_square_csr. The static string names the invariant, because “the graph is malformed” alone leaves the caller to bisect their own input.
SparseMatrixMustBeCsc
Error if the crate::prelude::CompressedSparseData2 is not in Csc.
ShapeMismatch
Shape mismatch problem for matrices
SparseLayoutMismatch
General error for sparse matrix format mismatches
Fields
expected: CompressedSparseFormatThe expected CompressedSparseFormat enum.
got: CompressedSparseFormatThe provided CompressedSparseFormat enum.
NotSerialised(&'static str)
The bytes do not open with the magic of the requested structure.
SerialisedVersionMismatch
The bytes were written by a different version of the byte layout.
SerialisedWidthMismatch
The bytes were written for different element types, e.g. an f64
structure read back as f32.
SerialisationFailed(String)
Encoding failed, or the payload behind a valid header did not decode.
Trait Implementations§
Source§impl Debug for CoreErrors
impl Debug for CoreErrors
Source§impl Display for CoreErrors
impl Display for CoreErrors
Source§impl Error for CoreErrors
impl Error for CoreErrors
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<AnnSearchErrors> for CoreErrors
impl From<AnnSearchErrors> for CoreErrors
Source§fn from(source: AnnSearchErrors) -> CoreErrors
fn from(source: AnnSearchErrors) -> CoreErrors
Source§impl From<CoreErrors> for MethodsErrors
impl From<CoreErrors> for MethodsErrors
Source§fn from(source: CoreErrors) -> Self
fn from(source: CoreErrors) -> Self
Source§impl From<LltError> for CoreErrors
impl From<LltError> for CoreErrors
Source§fn from(source: LltError) -> CoreErrors
fn from(source: LltError) -> CoreErrors
Source§impl From<SparseErrors> for CoreErrors
Maps each SparseErrors variant onto the identically named CoreErrors
variant, so callers keep matching on CoreErrors after the sparse structures
moved to bixverse-sparse.
impl From<SparseErrors> for CoreErrors
Maps each SparseErrors variant onto the identically named CoreErrors
variant, so callers keep matching on CoreErrors after the sparse structures
moved to bixverse-sparse.
Source§fn from(err: SparseErrors) -> CoreErrors
fn from(err: SparseErrors) -> CoreErrors
Auto Trait Implementations§
impl !RefUnwindSafe for CoreErrors
impl !UnwindSafe for CoreErrors
impl Freeze for CoreErrors
impl Send for CoreErrors
impl Sync for CoreErrors
impl Unpin for CoreErrors
impl UnsafeUnpin for CoreErrors
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Separable for Twhere
T: Display,
impl<T> Separable for Twhere
T: Display,
Source§fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
fn separate_by_policy(&self, policy: SeparatorPolicy<'_>) -> String
SeparatorPolicy. Read moreSource§fn separate_with_commas(&self) -> String
fn separate_with_commas(&self) -> String
Source§fn separate_with_spaces(&self) -> String
fn separate_with_spaces(&self) -> String
Source§fn separate_with_dots(&self) -> String
fn separate_with_dots(&self) -> String
Source§fn separate_with_underscores(&self) -> String
fn separate_with_underscores(&self) -> String
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.