Skip to content

Commit

Permalink
remove unnecessary ensure; length-1 dimensions in grid work fine
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Carow authored and Kyle Carow committed Nov 27, 2023
1 parent 95540fc commit 1b1b298
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions rust/fastsim-core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,6 @@ pub fn multilinear(point: &[f64], grid: &[Vec<f64>], values: &ArrayD<f64>) -> an
"Length of supplied `grid` must be same as `values` dimensionality: {grid:?} is not {n}-dimensional",
);
for i in 0..n {
// TODO: This ensure! could be removed if subsetting got rid of length 1 dimensions in `grid` and `points` as well
anyhow::ensure!(
grid[i].len() > 1,
"Supplied `grid` length must be > 1 for dimension {i}",
);
anyhow::ensure!(
grid[i].len() == values.shape()[i],
"Supplied `grid` and `values` are not compatible shapes: dimension {i}, lengths {} != {}",
Expand Down

0 comments on commit 1b1b298

Please sign in to comment.