const DOMAIN_ERROR_MSG: &str =
"Supplied value is outside the range of the supplied xdata or ydata.";
#[derive(thiserror::Error, Debug)]
pub enum InterpolationError {
#[error("x values must be strictly increasing.")]
UnsortedDataset,
#[error("Supplied datasets must be 1D and of equal length.")]
DatasetMismatch,
#[error("Supplied array size is less than the interpolation type's minimum size.")]
NotEnoughPoints,
#[error("Suppled z-grid dataset must be 1D with length of `xsize*ysize`.")]
ZGridMismatch,
#[error("BLAS error solving Tridiagonal matrix of {which_interp} Interpolator: {source}")]
BLASTridiagError {
which_interp: String,
#[source]
source: ndarray_linalg::error::LinalgError,
},
#[error("{DOMAIN_ERROR_MSG}")]
DomainError(#[from] DomainError),
#[error("`{0}`: Invalid Interpolation Type")]
InvalidType(Box<str>),
}
#[derive(thiserror::Error, Debug)]
#[error("{DOMAIN_ERROR_MSG}")]
pub struct DomainError;