diff --git a/petab/v2/lint.py b/petab/v2/lint.py index 2558ea3c..38b7ff74 100644 --- a/petab/v2/lint.py +++ b/petab/v2/lint.py @@ -39,7 +39,6 @@ "CheckUnusedExperiments", "CheckObservablesDoNotShadowModelEntities", "CheckUnusedConditions", - "CheckAllObservablesDefined", "CheckPriorDistribution", "lint_problem", "default_validation_tasks", @@ -261,8 +260,9 @@ def run(self, problem: Problem) -> ValidationIssue | None: } if undefined_observables := (used_observables - defined_observables): return ValidationError( - f"Observables {undefined_observables} used in " - "measurement table but not defined in observable table." + f"Observable(s) {undefined_observables} are used in the " + "measurement table but are not defined in the observable " + "table." ) return None @@ -289,8 +289,8 @@ def run(self, problem: Problem) -> ValidationIssue | None: expected = observable_parameters_count[m.observable_id] except KeyError: messages.append( - f"Observable {m.observable_id} used in measurement " - f"table is not defined." + f"Observable {m.observable_id} is used in the measurement " + f"table but is not defined in the observable table." ) continue @@ -443,31 +443,6 @@ def run(self, problem: Problem) -> ValidationIssue | None: return None -class CheckAllObservablesDefined(ValidationTask): - """A task to validate that all observables in the measurement table are - defined in the observable table.""" - - def run(self, problem: Problem) -> ValidationIssue | None: - if problem.measurement_df is None: - return None - - measurement_df = problem.measurement_df - observable_df = problem.observable_df - used_observables = set(measurement_df[OBSERVABLE_ID].values) - defined_observables = ( - set(observable_df.index.values) - if observable_df is not None - else set() - ) - if undefined_observables := (used_observables - defined_observables): - return ValidationError( - f"Observables {undefined_observables} are used in the" - "measurements table but are not defined in observables table." - ) - - return None - - class CheckUniquePrimaryKeys(ValidationTask): """Check that all primary keys are unique.""" @@ -1092,7 +1067,6 @@ def get_placeholders( # CheckVisualizationTable(), # TODO validate mapping table CheckValidParameterInConditionOrParameterTable(), - CheckAllObservablesDefined(), CheckAllParametersPresentInParameterTable(), CheckValidConditionTargets(), CheckPriorDistribution(),