|
39 | 39 | "CheckUnusedExperiments", |
40 | 40 | "CheckObservablesDoNotShadowModelEntities", |
41 | 41 | "CheckUnusedConditions", |
42 | | - "CheckAllObservablesDefined", |
43 | 42 | "CheckPriorDistribution", |
44 | 43 | "lint_problem", |
45 | 44 | "default_validation_tasks", |
@@ -261,8 +260,8 @@ def run(self, problem: Problem) -> ValidationIssue | None: |
261 | 260 | } |
262 | 261 | if undefined_observables := (used_observables - defined_observables): |
263 | 262 | return ValidationError( |
264 | | - f"Observables {undefined_observables} used in " |
265 | | - "measurement table but not defined in observable table." |
| 263 | + f"Observable(s) {undefined_observables} are used in the " |
| 264 | + "measurement table but are not defined in observable table." |
266 | 265 | ) |
267 | 266 |
|
268 | 267 | return None |
@@ -290,7 +289,7 @@ def run(self, problem: Problem) -> ValidationIssue | None: |
290 | 289 | except KeyError: |
291 | 290 | messages.append( |
292 | 291 | f"Observable {m.observable_id} used in measurement " |
293 | | - f"table is not defined." |
| 292 | + f"table is not defined in the observable table." |
294 | 293 | ) |
295 | 294 | continue |
296 | 295 |
|
@@ -443,31 +442,6 @@ def run(self, problem: Problem) -> ValidationIssue | None: |
443 | 442 | return None |
444 | 443 |
|
445 | 444 |
|
446 | | -class CheckAllObservablesDefined(ValidationTask): |
447 | | - """A task to validate that all observables in the measurement table are |
448 | | - defined in the observable table.""" |
449 | | - |
450 | | - def run(self, problem: Problem) -> ValidationIssue | None: |
451 | | - if problem.measurement_df is None: |
452 | | - return None |
453 | | - |
454 | | - measurement_df = problem.measurement_df |
455 | | - observable_df = problem.observable_df |
456 | | - used_observables = set(measurement_df[OBSERVABLE_ID].values) |
457 | | - defined_observables = ( |
458 | | - set(observable_df.index.values) |
459 | | - if observable_df is not None |
460 | | - else set() |
461 | | - ) |
462 | | - if undefined_observables := (used_observables - defined_observables): |
463 | | - return ValidationError( |
464 | | - f"Observables {undefined_observables} are used in the" |
465 | | - "measurements table but are not defined in observables table." |
466 | | - ) |
467 | | - |
468 | | - return None |
469 | | - |
470 | | - |
471 | 445 | class CheckUniquePrimaryKeys(ValidationTask): |
472 | 446 | """Check that all primary keys are unique.""" |
473 | 447 |
|
@@ -1092,7 +1066,6 @@ def get_placeholders( |
1092 | 1066 | # CheckVisualizationTable(), |
1093 | 1067 | # TODO validate mapping table |
1094 | 1068 | CheckValidParameterInConditionOrParameterTable(), |
1095 | | - CheckAllObservablesDefined(), |
1096 | 1069 | CheckAllParametersPresentInParameterTable(), |
1097 | 1070 | CheckValidConditionTargets(), |
1098 | 1071 | CheckPriorDistribution(), |
|
0 commit comments