1use thiserror::Error;
2use ndarray::ShapeError;
3
4
5#[derive(Error, Debug)]
7pub enum CsapsError {
8 #[error("Invalid input: {0}")]
10 InvalidInputData(String),
11
12 #[error("Cannot reshape 2-d array with shape {input_shape:?} \
14 to {}-d array with shape {output_shape:?} by axis {axis}. Error: {source}",
15 output_shape.len())]
16 ReshapeFrom2d {
17 input_shape: Vec<usize>,
18 output_shape: Vec<usize>,
19 axis: usize,
20 #[source]
21 source: ShapeError,
22 },
23
24 #[error("Cannot reshape {}-d array with shape {input_shape:?} by axis {axis} \
26 to 2-d array with shape {output_shape:?}. Error: {source}",
27 input_shape.len())]
28 ReshapeTo2d {
29 input_shape: Vec<usize>,
30 output_shape: Vec<usize>,
31 axis: usize,
32 #[source]
33 source: ShapeError,
34 },
35}