From a1bcf70fc975a9eb44d7f10f1fe3ab31fce32fe8 Mon Sep 17 00:00:00 2001 From: dilpath Date: Mon, 18 Nov 2024 18:20:13 +0100 Subject: [PATCH] closes #44 --- petab_select/constants.py | 2 ++ petab_select/model.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/petab_select/constants.py b/petab_select/constants.py index bba90ac..b56e8a4 100644 --- a/petab_select/constants.py +++ b/petab_select/constants.py @@ -141,6 +141,8 @@ class Criterion(str, Enum): LLH = "LLH" #: The negative log-likelihood. NLLH = "NLLH" + #: The sum of squared residuals. + SSR = "SSR" #: Methods that move through model space by taking steps away from some model. diff --git a/petab_select/model.py b/petab_select/model.py index d1c00c2..6439106 100644 --- a/petab_select/model.py +++ b/petab_select/model.py @@ -274,9 +274,11 @@ def compute_criterion( criterion_value = self.criterion_computer(criterion) self.set_criterion(criterion, criterion_value) result = criterion_value - except ValueError: + except ValueError as err: if raise_on_failure: - raise + raise ValueError( + f"Insufficient information to compute criterion `{criterion}`." + ) from err result = None return result