petab.v1.yaml
Code regarding the PEtab YAML config files
Functions
Check that there is only a single condition file and a single SBML file specified. |
|
|
Create and write default YAML file for a single PEtab problem |
|
Get the path prefix from a PEtab problem yaml file. |
|
Does this YAML file comprise multiple models? |
|
Load YAML |
|
Validate syntax and semantics of PEtab config YAML |
|
Validate PEtab YAML file semantics |
|
Validate PEtab YAML file syntax |
|
Write PEtab YAML file |
- petab.v1.yaml.assert_single_condition_and_sbml_file(problem_config: dict) None [source]
Check that there is only a single condition file and a single SBML file specified.
- Parameters:
problem_config – Dictionary as defined in the YAML schema inside the problems list.
- Raises:
NotImplementedError – If multiple condition or SBML files specified.
- petab.v1.yaml.create_problem_yaml(sbml_files: str | Path | list[str | Path], condition_files: str | Path | list[str | Path], measurement_files: str | Path | list[str | Path], parameter_file: str | Path, observable_files: str | Path | list[str | Path], yaml_file: str | Path, visualization_files: str | Path | list[str | Path] | None = None, relative_paths: bool = True, mapping_files: str | Path | list[str | Path] | None = None) None [source]
Create and write default YAML file for a single PEtab problem
- Parameters:
sbml_files – Path of SBML model file or list of such
condition_files – Path of condition file or list of such
measurement_files – Path of measurement file or list of such
parameter_file – Path of parameter file
observable_files – Path of observable file or list of such
yaml_file – Path to which YAML file should be written
visualization_files – Optional Path to visualization file or list of such
relative_paths – whether all paths in the YAML file should be relative to the location of the YAML file. If
False
, then paths are left unchanged.mapping_files – Path of mapping file
- petab.v1.yaml.get_path_prefix(yaml_path: Path | str) str [source]
Get the path prefix from a PEtab problem yaml file.
Get the path prefix to retrieve any files with relative paths referenced in the given PEtab problem yaml file.
- Parameters:
yaml_path – PEtab problem YAML file path (local or URL).
- Returns:
The path prefix for retrieving any referenced files with relative paths.
- petab.v1.yaml.is_composite_problem(yaml_config: dict | str | Path) bool [source]
Does this YAML file comprise multiple models?
- Parameters:
yaml_config – PEtab configuration as dictionary or YAML file name
- petab.v1.yaml.load_yaml(yaml_config: dict | Path | str) dict [source]
Load YAML
Convenience function to allow for providing YAML inputs as filename, URL or as dictionary.
- Parameters:
yaml_config – PEtab YAML config as filename or dict or URL.
- Returns:
The unmodified dictionary if
yaml_config
was dictionary. Otherwise the parsed the YAML file.
- petab.v1.yaml.validate(yaml_config: dict | str | Path, path_prefix: None | str | Path = None)[source]
Validate syntax and semantics of PEtab config YAML
- 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.
- petab.v1.yaml.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