Commit 14bcf4ae authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

improve dealing with situation where q_lvl provided in place of c_lvl

1 merge request!9Draft: Resolve "evaluation of quantiles prediction"
Pipeline #63427 failed with stage
in 3 minutes and 45 seconds
Showing with 3 additions and 3 deletions
+3 -3
......@@ -146,11 +146,11 @@ namespace evalhyd
auto get_c_lvl()
{
if (_c_lvl.size() < 1)
if (_c_lvl.size() < 1 && _q_lvl.size() < 1)
{
throw std::runtime_error(
"interval-based metric requested, "
"but *c_lvl* not provided"
"but neither *c_lvl* nor *q_lvl* provided"
);
}
else{
......@@ -515,7 +515,7 @@ namespace evalhyd
n_tim = q_prd.shape(3);
n_msk = t_msk.shape(2);
n_thr = _q_thr.shape(1);
n_itv = _c_lvl.size();
n_itv = _q_lvl.size() > 0 ? _q_lvl.size() : _c_lvl.size();
n_exp = b_exp.size();
// drop time steps where observations and/or predictions are NaN
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment