#[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("Supplied 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("{0}")]
Domain1dError(#[from] Domain1dError),
#[error("{0}")]
Domain2dError(#[from] Domain2dError),
}
#[derive(thiserror::Error, Debug)]
#[error("1D Interpolation domain error: x = {x}")]
pub struct Domain1dError {
pub x: f64,
}
#[derive(thiserror::Error, Debug)]
#[error("1D Interpolation domain error: x = {x}, y = {y}")]
pub struct Domain2dError {
pub x: f64,
pub y: f64,
}