From 56919dbc1ffc52604a74ad289fce133647cca79c Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 4 Dec 2024 11:04:18 +0100 Subject: [PATCH] Fix missing/incorrect yaml schemas Closes #588. --- doc/conf.py | 2 +- doc/v1/_static/petab_schema_v1.yaml | 86 +++++++++++++++++++ doc/v1/documentation_data_format.rst | 9 +- .../_static/petab_schema_v2.yaml} | 0 doc/v2/documentation_data_format.rst | 9 +- 5 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 doc/v1/_static/petab_schema_v1.yaml rename doc/{_static/petab_schema.yaml => v2/_static/petab_schema_v2.yaml} (100%) diff --git a/doc/conf.py b/doc/conf.py index e5c00715..832b8358 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -88,7 +88,7 @@ def setup(app): # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +html_static_path = ['_static', 'v1/_static', 'v2/_static'] html_context = { "display_github": True, diff --git a/doc/v1/_static/petab_schema_v1.yaml b/doc/v1/_static/petab_schema_v1.yaml new file mode 100644 index 00000000..bf012e57 --- /dev/null +++ b/doc/v1/_static/petab_schema_v1.yaml @@ -0,0 +1,86 @@ +# For syntax see: https://json-schema.org/understanding-json-schema/index.html +#$schema: "https://json-schema.org/draft/2019-09/meta/core" +$schema: "http://json-schema.org/draft-06/schema" +description: PEtab parameter estimation problem config file schema + +properties: + + format_version: + type: integer + description: Version of the PEtab format (e.g. 1). + + parameter_file: + oneOf: + - type: string + - type: array + description: | + 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: + + sbml_files: + type: array + description: List of PEtab SBML files. + + items: + type: string + description: PEtab SBML file name or URL. + + measurement_files: + type: array + description: List of PEtab measurement files. + + items: + type: string + description: PEtab measurement file name or URL. + + condition_files: + type: array + description: List of PEtab condition files. + + items: + type: string + description: PEtab condition file name or URL. + + observable_files: + type: array + description: List of PEtab observable files. + + items: + type: string + description: PEtab observable file name or URL. + + visualization_files: + type: array + description: List of PEtab visualization files. + + items: + type: string + description: PEtab visualization file name or URL. + + required: + - sbml_files + - observable_files + - measurement_files + - condition_files + +required: + - format_version + - parameter_file + - problems diff --git a/doc/v1/documentation_data_format.rst b/doc/v1/documentation_data_format.rst index c3af75f9..a1d52874 100644 --- a/doc/v1/documentation_data_format.rst +++ b/doc/v1/documentation_data_format.rst @@ -709,9 +709,12 @@ to change in the future). Furthermore, this can be used to describe parameter estimation problems comprising multiple models (more details below). -The format is described in the schema -`../petab/petab_schema.yaml <_static/petab_schema.yaml>`_, which allows for -easy validation. +The format is described in the +`jsonschema <../_static/petab_schema_v1.yaml>`_, which allows for +easy validation: + +.. literalinclude:: _static/petab_schema_v1.yaml + :language: yaml Parameter estimation problems combining multiple models diff --git a/doc/_static/petab_schema.yaml b/doc/v2/_static/petab_schema_v2.yaml similarity index 100% rename from doc/_static/petab_schema.yaml rename to doc/v2/_static/petab_schema_v2.yaml diff --git a/doc/v2/documentation_data_format.rst b/doc/v2/documentation_data_format.rst index a969fbe9..3ed4df4d 100644 --- a/doc/v2/documentation_data_format.rst +++ b/doc/v2/documentation_data_format.rst @@ -805,9 +805,12 @@ This file also allows specifying a PEtab version and employed PEtab extensions. Furthermore, this can be used to describe parameter estimation problems comprising multiple models (more details below). -The format is described in the schema -`../petab/petab_schema.yaml <_static/petab_schema.yaml>`_, which allows for -easy validation. +The format is described in the +`jsonschema <../_static/petab_schema_v2.yaml>`_, which allows for +easy validation: + +.. literalinclude:: _static/petab_schema_v2.yaml + :language: yaml Parameter estimation problems combining multiple models