petab.v2.petab1to2

Convert PEtab version 1 problems to version 2.

Functions

petab1to2(yaml_config[, output_dir])

Convert from PEtab 1.0 to PEtab 2.0 format.

petab_files_1to2(yaml_config, output_dir)

Convert PEtab files from PEtab 1.0 to PEtab 2.0.

v1v2_condition_df(condition_df, model)

Convert condition table from petab v1 to v2.

v1v2_observable_df(observable_df)

Convert observable table from petab v1 to v2.

v1v2_parameter_df(parameter_df)

Convert parameter table from petab v1 to v2.

petab.v2.petab1to2.petab1to2(yaml_config: Path | str, output_dir: Path | str = None) Problem | None[source]

Convert from PEtab 1.0 to PEtab 2.0 format.

Convert a PEtab problem from PEtab 1.0 to PEtab 2.0 format.

Note

Some aspects of PEtab v1 were not well-defined. For example, model initialization order (e.g., applying initial assignments before or after condition table overrides) and the impact of compartment size changes were not specified. In such cases, we made assumptions that are consistent with the clarified PEtab v2 specifications, the PEtab test suite, or common practice. Therefore, it is recommended to carefully review the generated PEtab v2 problem to ensure it aligns with the expected behavior.

Parameters:
  • yaml_config – The PEtab problem as dictionary or YAML file name.

  • output_dir – The output directory to save the converted PEtab problem, or None, to return a petab.v2.Problem instance.

Raises:

ValueError – If the input is invalid or does not pass linting or if the generated files do not pass linting.