petab_select.ui

Functions

best(problem, models[, criterion])

Get the best model from a list of models.

candidates(problem[, candidate_space, ...])

Search the model space for candidate models.

model_to_petab(model[, output_path])

Generate the PEtab problem for a model.

models_to_petab(models[, output_path_prefix])

Generate the PEtab problems for a list of models.

write_summary_tsv(problem[, ...])

rtype:

None

petab_select.ui.best(problem, models, criterion=None)[source]

Get the best model from a list of models.

Parameters:
  • problem (Problem) – The PEtab Select problem.

  • models (List[Model]) – The list of models.

  • criterion (Optional[str]) – The criterion by which models will be compared. Defaults to problem.criterion.

Return type:

Model

Returns:

The best model.

petab_select.ui.candidates(problem, candidate_space=None, limit=inf, limit_sent=inf, calibrated_models=None, newly_calibrated_models=None, excluded_models=None, excluded_model_hashes=None, criterion=None)[source]

Search the model space for candidate models.

A predecessor model is chosen from newly_calibrated_models if available, otherwise from calibrated_models, and is used for applicable methods.

Parameters:
  • problem (Problem) – A PEtab Select problem.

  • candidate_space (Optional[CandidateSpace]) – The candidate space. Defaults to a new candidate space based on the method defined in the problem.

  • limit (Union[float, int]) – The maximum number of models to add to the candidate space.

  • limit_sent (Union[float, int]) – The maximum number of models sent to the candidate space (which are possibly rejected and excluded).

  • calibrated_models (Optional[Dict[str, Model]]) – All calibrated models in the model selection.

  • newly_calibrated_models (Optional[Dict[str, Model]]) – All calibrated models in the most recent iteration of model selection.

  • excluded_models (Optional[List[Model]]) – Models that will be excluded from model subspaces during the search for candidates.

  • excluded_model_hashes (Optional[List[str]]) – Hashes of models that will be excluded from model subspaces during the search for candidates.

  • criterion (Optional[Criterion]) – The criterion by which models will be compared. Defaults to the criterion defined in the PEtab Select problem.

Return type:

CandidateSpace

Returns:

The candidate space, which contains the candidate models.

petab_select.ui.model_to_petab(model, output_path=None)[source]

Generate the PEtab problem for a model.

Parameters:
  • model (Model) – The model.

  • output_path (Union[Path, str, None]) – If specified, the PEtab problem will be output to files in this directory.

Return type:

Dict[str, Union[Problem, str, Path]]

Returns:

The PEtab problem, and the path to the PEtab problem YAML file, if an output path is provided.

petab_select.ui.models_to_petab(models, output_path_prefix=None)[source]

Generate the PEtab problems for a list of models.

Parameters:
  • models (List[Model]) – The list of model.

  • output_path_prefix (Optional[List[Union[str, Path]]]) – If specified, the PEtab problem will be output to files in subdirectories of this path, where each subdirectory corresponds to a model.

Return type:

List[Dict[str, Union[Problem, str, Path]]]

Returns:

The PEtab problems, and the paths to the PEtab problem YAML files, if an output path prefix is provided.