petab_select.model_space

The ModelSpace class and related methods.

Functions

get_model_space_df(df)

rtype:

DataFrame

line2row(line[, delimiter, unpacked, ...])

Parse a line from a model space file.

read_model_space_file(filename)

Read a model space file.

write_model_space_df(df, filename)

rtype:

None

Classes

ModelSpace(model_subspaces)

A model space, as a collection of model subspaces.

class petab_select.model_space.ModelSpace(model_subspaces)[source]

A model space, as a collection of model subspaces.

model_subspaces

List of model subspaces.

exclusions

Hashes of models that are excluded from the model space.

__init__(model_subspaces)[source]
static from_files(filenames)[source]

Create a model space from model space files.

Parameters:

filenames (List[Union[str, Path]]) – The locations of the model space files.

Returns:

The corresponding model space.

reset_exclusions(exclusions=None)[source]

Reset the exclusions in the model subspaces.

Return type:

None

search(candidate_space, limit=inf, exclude=True)[source]

…TODO

Parameters:
  • candidate_space (CandidateSpace) – The candidate space.

  • limit (int) – The maximum number of models to send to the candidate space (i.e. this limit is on the number of models considered, not necessarily approved as candidates). Note that using a limit may produce unexpected results. For example, it may bias candidate models to be chosen only from a subset of model subspaces.

  • exclude (bool) – Whether to exclude the new candidates from the model subspaces.

petab_select.model_space.read_model_space_file(filename)[source]

Read a model space file.

The model space specification is currently expanded and written to a temporary file.

Parameters:

filename (str) – The name of the file to be unpacked.

Return type:

TextIO

Returns:

A temporary file object, which is the unpacked file.