rsl_interpolation/
error.rs1#[derive(thiserror::Error, Debug)]
2pub enum InterpolationError {
4 #[error("x values must be strictly increasing.")]
6 UnsortedDataset,
7
8 #[error("Supplied datasets must be 1D and of equal length.")]
10 DatasetMismatch,
11
12 #[error("Supplied array size is less than the interpolation type's minimum size.")]
14 NotEnoughPoints,
15
16 #[error("Supplied z-grid dataset must be 1D with length of `xsize*ysize`.")]
18 ZGridMismatch,
19
20 #[error("BLAS error solving Tridiagonal matrix of {which_interp} Interpolator: {source}")]
22 BLASTridiagError {
23 which_interp: String,
24 #[source]
25 source: ndarray_linalg::error::LinalgError,
26 },
27
28 #[error("{0}")]
30 Domain1dError(#[from] Domain1dError),
31
32 #[error("{0}")]
34 Domain2dError(#[from] Domain2dError),
35}
36
37#[derive(thiserror::Error, Debug)]
39#[error("1D Interpolation domain error: x = {x}")]
40pub struct Domain1dError {
41 pub x: f64,
42}
43
44#[derive(thiserror::Error, Debug)]
46#[error("1D Interpolation domain error: x = {x}, y = {y}")]
47pub struct Domain2dError {
48 pub x: f64,
49 pub y: f64,
50}