diff --git a/backend/pkdb_app/data/models.py b/backend/pkdb_app/data/models.py index 2845bda6..45549e25 100644 --- a/backend/pkdb_app/data/models.py +++ b/backend/pkdb_app/data/models.py @@ -214,7 +214,8 @@ def validate_timecourse(self, timecourse): name = self.get_name(timecourse[key], value) else: name = list(timecourse[key]) - raise ValueError(f"Subset used for timecourse is not unique on '{key}'. Values are '{name}'. " + label = timecourse['label'] + raise ValueError(f"Subset with label '{label}' used for timecourse is not unique on '{key}'. Values are '{name}'. " f"Check uniqueness of labels for timecourses.") diff --git a/backend/pkdb_app/outputs/pk_calculation.py b/backend/pkdb_app/outputs/pk_calculation.py index 73fb5652..5e563bb1 100644 --- a/backend/pkdb_app/outputs/pk_calculation.py +++ b/backend/pkdb_app/outputs/pk_calculation.py @@ -43,9 +43,11 @@ def pkoutputs_from_timecourse(subset: Subset) -> List[Dict]: if dosing: if dosing.application.info_node.name == "single dose" and timecourse["substance"] == dosing.substance.pk: pkinf = pharmacokinetics.TimecoursePK(**variables) + if not pkinf: _ = variables.pop("dosing", None) _ = variables.pop("intervention_time", None) + print(variables) pkinf = pharmacokinetics.TimecoursePKNoDosing(**variables) pk = pkinf.pk