petab.v2.lint
Validation of PEtab problems
Module Attributes
Validation tasks that should be run on any PEtab problem |
Functions
|
Get all placeholder parameters from observable table observableFormulas and noiseFormulas. |
|
Get the set of parameters that need to go into the parameter table |
|
Get the set of parameters which may be present inside the parameter table |
|
Validate a PEtab problem. |
Classes
Ensure all required parameters are contained in the parameter table with no additional ones. |
|
A task to validate that all conditions in the experiment table exist in the condition table. |
|
A task to validate the experiment table of a PEtab problem. |
|
Check that changes of any first period of any experiment only refers to allowed symbols. |
|
A task to check that all experiments referenced by measurements are defined. |
|
A task to check that all observables referenced by the measurements are defined. |
|
Validate model IDs of measurements. |
|
A task to validate the model of a PEtab problem. |
|
A task to check that observable IDs do not shadow model entities. |
|
A task to check that the number of observable/noise parameters in the measurements matches the number of placeholders in the observables. |
|
Check that measurements for observables with log-transformation are positive. |
|
A task to validate the prior distribution of a PEtab problem. |
|
A task to validate the configuration of a PEtab problem. |
|
A task to check for experiments that are used in the measurement table but not defined in the experiment table. |
|
Check that all primary keys are unique. |
|
A task to check for conditions that are not used in the experiment table. |
|
A task to check for experiments that are not used in the measurement table. |
|
Check that all condition table targets are valid. |
|
A task to check that all required and only allowed model parameters are present in the condition or parameter table. |
|
|
A validation result with level ERROR. |
|
The result of a validation task. |
|
The severity of a validation issue. |
|
A list of validation results. |
A task to validate a PEtab problem. |
|
|
A validation result with level WARNING. |
- class petab.v2.lint.CheckAllParametersPresentInParameterTable[source]
Bases:
ValidationTaskEnsure all required parameters are contained in the parameter table with no additional ones.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckExperimentConditionsExist[source]
Bases:
ValidationTaskA task to validate that all conditions in the experiment table exist in the condition table.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckExperimentTable[source]
Bases:
ValidationTaskA task to validate the experiment table of a PEtab problem.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckInitialChangeSymbols[source]
Bases:
ValidationTaskCheck that changes of any first period of any experiment only refers to allowed symbols.
The only allowed symbols are those that are present in the parameter table.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckMeasuredExperimentsDefined[source]
Bases:
ValidationTaskA task to check that all experiments referenced by measurements are defined.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckMeasuredObservablesDefined[source]
Bases:
ValidationTaskA task to check that all observables referenced by the measurements are defined.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckMeasurementModelId[source]
Bases:
ValidationTaskValidate model IDs of measurements.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckModel[source]
Bases:
ValidationTaskA task to validate the model of a PEtab problem.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckObservablesDoNotShadowModelEntities[source]
Bases:
ValidationTaskA task to check that observable IDs do not shadow model entities.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckOverridesMatchPlaceholders[source]
Bases:
ValidationTaskA task to check that the number of observable/noise parameters in the measurements matches the number of placeholders in the observables.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckPosLogMeasurements[source]
Bases:
ValidationTaskCheck that measurements for observables with log-transformation are positive.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckPriorDistribution[source]
Bases:
ValidationTaskA task to validate the prior distribution of a PEtab problem.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckProblemConfig[source]
Bases:
ValidationTaskA task to validate the configuration of a PEtab problem.
This corresponds to checking the problem YAML file semantics.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckUndefinedExperiments[source]
Bases:
ValidationTaskA task to check for experiments that are used in the measurement table but not defined in the experiment table.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckUniquePrimaryKeys[source]
Bases:
ValidationTaskCheck that all primary keys are unique.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckUnusedConditions[source]
Bases:
ValidationTaskA task to check for conditions that are not used in the experiment table.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckUnusedExperiments[source]
Bases:
ValidationTaskA task to check for experiments that are not used in the measurement table.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckValidConditionTargets[source]
Bases:
ValidationTaskCheck that all condition table targets are valid.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.CheckValidParameterInConditionOrParameterTable[source]
Bases:
ValidationTaskA task to check that all required and only allowed model parameters are present in the condition or parameter table.
- run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- class petab.v2.lint.ValidationError(message: str, task: str | None = None)[source]
Bases:
ValidationIssueA validation result with level ERROR.
- level: ValidationIssueSeverity = 30
- class petab.v2.lint.ValidationIssue(level: ValidationIssueSeverity, message: str, task: str | None = None)[source]
Bases:
objectThe result of a validation task.
- level
The level of the validation event.
- level: ValidationIssueSeverity
- class petab.v2.lint.ValidationIssueSeverity(*values)[source]
Bases:
IntEnumThe severity of a validation issue.
- CRITICAL = 40
- ERROR = 30
- INFO = 10
- WARNING = 20
- class petab.v2.lint.ValidationResultList(iterable=(), /)[source]
Bases:
list[ValidationIssue]A list of validation results.
Contains all issues found during the validation of a PEtab problem.
- log(*, logger: Logger = <Logger petab.v2.lint (WARNING)>, min_level: ValidationIssueSeverity = ValidationIssueSeverity.INFO, max_level: ValidationIssueSeverity = ValidationIssueSeverity.CRITICAL)[source]
Log the validation results.
- Parameters:
logger – The logger to use for logging. Defaults to the module logger.
min_level – The minimum severity level to log.
max_level – The maximum severity level to log.
- class petab.v2.lint.ValidationTask[source]
Bases:
ABCA task to validate a PEtab problem.
- abstractmethod run(problem: Problem) ValidationIssue | None[source]
Run the validation task.
- Parameters:
problem – PEtab problem to check.
- Returns:
Validation results or
None
- petab.v2.lint.default_validation_tasks = [<petab.v2.lint.CheckProblemConfig object>, <petab.v2.lint.CheckModel object>, <petab.v2.lint.CheckUniquePrimaryKeys object>, <petab.v2.lint.CheckMeasurementModelId object>, <petab.v2.lint.CheckMeasuredObservablesDefined object>, <petab.v2.lint.CheckPosLogMeasurements object>, <petab.v2.lint.CheckOverridesMatchPlaceholders object>, <petab.v2.lint.CheckValidConditionTargets object>, <petab.v2.lint.CheckExperimentTable object>, <petab.v2.lint.CheckExperimentConditionsExist object>, <petab.v2.lint.CheckUndefinedExperiments object>, <petab.v2.lint.CheckObservablesDoNotShadowModelEntities object>, <petab.v2.lint.CheckAllParametersPresentInParameterTable object>, <petab.v2.lint.CheckValidParameterInConditionOrParameterTable object>, <petab.v2.lint.CheckUnusedExperiments object>, <petab.v2.lint.CheckUnusedConditions object>, <petab.v2.lint.CheckPriorDistribution object>, <petab.v2.lint.CheckInitialChangeSymbols object>]
Validation tasks that should be run on any PEtab problem