You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e46ef71
Browse filesBrowse the repository at this point in the historyBrowse files
v2: split and validate multi-model problems (#537)
Closes#392.
PEtab v2 problems can have more than one model. So far
`Problem.validate()` only warned about this, and every task that touches
`Problem.model` failed. As a result, `validate().has_errors()` was
always true for such problems.
**Changes**
* New `Problem.split_by_model() -> dict[str, Problem]`. It returns one
single-model problem per model, containing:
* that model's measurements;
* the experiments and conditions they reference;
* the measured observables;
* the mappings that don't resolve in another model (so extension
mappings such as SciML's are kept);
* the shared parameters that are valid for that model.
It raises on duplicate model IDs and on measurements that aren't
assigned to a model. With a single model, `modelId` stays optional.
* `Problem.validate()` on multi-model problems:
* checks the model IDs (`CheckMeasurementModelId`, duplicate model IDs)
on the full problem and stops there if they're invalid;
* runs `CheckUniquePrimaryKeys`, `CheckMappingTable`,
`CheckUnusedExperiments` and `CheckUnusedConditions` on the full
problem, because the split drops unused entries and other models'
mappings;
* runs the remaining tasks on each part, and prefixes each issue's
message with ``Model `<id>`: ``;
* reports parameters that no model uses as an error, if
`CheckAllParametersPresentInParameterTable` is requested. The
single-model extraneous-parameter check can't see them after the split.
* `Problem.__str__` no longer raises for multi-model problems.
* `Problem.add_measurement(..., model_id=...)`.
**Downstream**: pyPESTO ICB-DCM/pyPESTO#1772
adds multi-model PEtab v2 support. It currently carries its own copies
of these helpers (`split_petab_problem_by_model`,
`_validate_petab_v2_problem`), which it can drop once this is released.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments