Skip to content

v2: Adapt to updated yaml schema #394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions petab/petablint.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ def main():
logger.error(e)
sys.exit(1)

if petab.is_composite_problem(args.yaml_file_name):
# TODO: further checking:
# https://github.com/ICB-DCM/PEtab/issues/191
# problem = petab.CompositeProblem.from_yaml(args.yaml_file_name)
return

match get_major_version(args.yaml_file_name):
case 1:
if petab.is_composite_problem(args.yaml_file_name):
# TODO: further checking:
# https://github.com/ICB-DCM/PEtab/issues/191
# petab.CompositeProblem.from_yaml(args.yaml_file_name)
return

problem = petab.Problem.from_yaml(args.yaml_file_name)
ret = petab.lint.lint_problem(problem)
sys.exit(ret)
Expand Down
104 changes: 41 additions & 63 deletions petab/schemas/petab_schema.v2.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,71 +31,47 @@ properties:
File name (absolute or relative) or URL to PEtab parameter table
containing parameters of all models listed in `problems`. A single
table may be split into multiple files and described as an array here.
problems:
type: array
description: |
One or multiple PEtab problems (sets of model, condition, observable
and measurement files). If different model and data files are
independent, they can be specified as separate PEtab problems, which
may allow more efficient handling. Files in one problem cannot refer
to models entities or data specified inside another problem.
items:

type: object
description: |
A set of PEtab model, condition, observable and measurement
files and optional visualization files.
properties:

model_files:
type: object
description: One or multiple models

# the model ID
patternProperties:
"^[a-zA-Z_]\\w*$":
type: object
properties:
location:
type: string
description: Model file name or URL
language:
type: string
description: |
Model language, e.g., 'sbml', 'cellml', 'bngl', 'pysb'
required:
- location
- language
additionalProperties: false

measurement_files:
description: List of PEtab measurement files.
$ref: "#/definitions/list_of_files"

condition_files:
description: List of PEtab condition files.
$ref: "#/definitions/list_of_files"

experiment_files:
description: List of PEtab experiment files.
$ref: "#/definitions/list_of_files"

observable_files:
description: List of PEtab observable files.
$ref: "#/definitions/list_of_files"

visualization_files:
description: List of PEtab visualization files.
$ref: "#/definitions/list_of_files"

mapping_file:
model_files:
type: object
description: One or multiple models

# the model ID
patternProperties:
"^[a-zA-Z_]\\w*$":
type: object
properties:
location:
type: string
description: Optional PEtab mapping file name or URL.
description: Model file name or URL
language:
type: string
description: |
Model language, e.g., 'sbml', 'cellml', 'bngl', 'pysb'
required:
- location
- language
additionalProperties: false

measurement_files:
description: List of PEtab measurement files.
$ref: "#/definitions/list_of_files"

condition_files:
description: List of PEtab condition files.
$ref: "#/definitions/list_of_files"

experiment_files:
description: List of PEtab experiment files.
$ref: "#/definitions/list_of_files"

observable_files:
description: List of PEtab observable files.
$ref: "#/definitions/list_of_files"

required:
- model_files
- observable_files
- measurement_files
mapping_files:
description: List of PEtab mapping files.
$ref: "#/definitions/list_of_files"

extensions:
type: object
Expand All @@ -120,4 +96,6 @@ properties:
required:
- format_version
- parameter_file
- problems
- model_files
- observable_files
- measurement_files
6 changes: 3 additions & 3 deletions petab/v2/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ def run(self, problem: Problem) -> ValidationIssue | None:
# TODO: we need some option for validating partial vs full problems
# check for unset but required files
missing_files = []
if not config.parameter_file:
if not config.parameter_files:
missing_files.append("parameters")

if not [p.measurement_files for p in config.problems]:
if not config.measurement_files:
missing_files.append("measurements")

if not [p.observable_files for p in config.problems]:
if not config.observable_files:
missing_files.append("observables")

if missing_files:
Expand Down
Loading
Loading