Skip to content

Commit

Permalink
Raise exception on dimension mismatch in calc_quantile
Browse files Browse the repository at this point in the history
  • Loading branch information
tnipen committed Mar 13, 2024
1 parent a25715a commit a0d52f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ vec gridpp::calc_quantile(const vec2& array, float quantile) {
return output;
}
vec2 gridpp::calc_quantile(const vec3& array, const vec2& quantile) {
gridpp::compatible_size(quantile, array);
if(!gridpp::compatible_size(quantile, array))
throw std::invalid_argument("Dimension mismatch between array and quantile");
int Y = array.size();
if(Y == 0)
return vec2();
Expand Down

0 comments on commit a0d52f7

Please sign in to comment.