nessai.utils.sorting

Utilities for sorting.

Module Contents

Functions

sort_reparameterisations(...)

Sort reparameterisations based on their parameters and requirements.

nessai.utils.sorting.sort_reparameterisations(reparameterisations: List[nessai.reparameterisations.Reparameterisation], existing_parameters: List[str] | None = None, known_parameters: List[str] | None = None, initial_sort: bool = True) List[nessai.reparameterisations.Reparameterisation]

Sort reparameterisations based on their parameters and requirements.

Parameters:
reparameterisationsList[Reparameterisation]

List of reparameterisations.

existing_parametersOptional[List[str]]

List of parameters that are all included.

known_parametersOptional[List[str]]

List of all known parameters. If not specified it is inferred from the list of reparameterisations.

initial_sortbool

Toggle initial sorting by the number of requirements.

Returns:
List[Reparameterisation]

Sorted list of reparameterisations.

Raises:
ValueError

If a required parameter is missing from the known parameters.