rsl_interpolation/
error.rs1const DOMAIN_ERROR_MSG: &str =
2 "Supplied value is outside the range of the supplied xdata or ydata.";
3
4#[derive(thiserror::Error, Debug)]
5pub enum InterpolationError {
7 #[error("x values must be strictly increasing.")]
9 UnsortedDataset,
10
11 #[error("Supplied datasets must be 1D and of equal length.")]
13 DatasetMismatch,
14
15 #[error("Supplied array size is less than the interpolation type's minimum size.")]
17 NotEnoughPoints,
18
19 #[error("Suppled z-grid dataset must be 1D with length of `xsize*ysize`.")]
21 ZGridMismatch,
22
23 #[error("BLAS error solving Tridiagonal matrix of {which_interp} Interpolator: {source}")]
25 BLASTridiagError {
26 which_interp: String,
27 #[source]
28 source: ndarray_linalg::error::LinalgError,
29 },
30
31 #[error("{DOMAIN_ERROR_MSG}")]
33 DomainError(#[from] DomainError),
34
35 #[error("`{0}`: Invalid Interpolation Type")]
37 InvalidType(Box<str>),
38}
39
40#[derive(thiserror::Error, Debug)]
41#[error("{DOMAIN_ERROR_MSG}")]
42#[non_exhaustive]
43pub struct DomainError;