petab.petablint

Command line tool to check for correct format

Functions

main()

Run PEtab validator

parse_cli_args()

Parse command line arguments

Classes

LintFormatter([fmt, datefmt, style, ...])

Custom log formatter

class petab.petablint.LintFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]

Bases: Formatter

Custom log formatter

format(record)[source]

Format the specified record as text.

The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.

formats = {10: '\x1b[36m%(message)s', 20: '\x1b[32m%(message)s', 30: '\x1b[33m%(message)s', 40: '\x1b[31m%(message)s'}
petab.petablint.SchemaValidationError

alias of ValidationError

petab.petablint.get_major_version(problem: str | dict | Path | Problem | Problem) int[source]

Get the major version number of the given problem.

petab.petablint.init_colorama(autoreset=False, convert=None, strip=None, wrap=True)
petab.petablint.main()[source]

Run PEtab validator

petab.petablint.parse_cli_args()[source]

Parse command line arguments

petab.petablint.validate_yaml_semantics(yaml_config: dict | str | Path, path_prefix: None | str | Path = None)[source]

Validate PEtab YAML file semantics

Check for existence of files. Assumes valid syntax.

Version number and contents of referenced files are not yet checked.

Parameters:
  • yaml_config – PEtab YAML config as filename or dict.

  • path_prefix – Base location for relative paths. Defaults to location of YAML file if a filename was provided for yaml_config or the current working directory.

Raises:

AssertionError – in case of problems

petab.petablint.validate_yaml_syntax(yaml_config: dict | str | Path, schema: None | dict | str = None)[source]

Validate PEtab YAML file syntax

Parameters:
  • yaml_config – PEtab YAML file to validate, as file name or dictionary

  • schema – Custom schema for validation

:raises see jsonschema.validate():