bilby.core.result.ResultList

class bilby.core.result.ResultList(results=None, consistency_level='warning')[source]

Bases: list

__init__(results=None, consistency_level='warning')[source]

A class to store a list of bilby.core.result.Result objects from equivalent runs on the same data. This provides methods for outputting combined results.

Parameters:
results: list

A list of :class:`bilby.core.result.Result.

consistency_level: str, [ignore, warning, error]

If warning, print a warning if inconsistencies are discovered between the results. If error, raise an error if inconsistencies are discovered between the results before combining. If ignore, do nothing.

__call__(*args, **kwargs)

Call self as a function.

Methods

__init__([results, consistency_level])

A class to store a list of bilby.core.result.Result objects from equivalent runs on the same data.

append(result)

Append a bilby.core.result.Result, or set of results, to the list.

check_consistent_data()

check_consistent_parameters()

check_consistent_priors()

check_consistent_sampler()

check_nested_samples()

clear(/)

Remove all items from list.

combine([shuffle, consistency_level])

Return the combined results in a :class:bilby.core.result.Result` object.

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(iterable, /)

Extend list by appending elements from the iterable.

index(value[, start, stop])

Return first index of value.

insert(index, object, /)

Insert object before index.

pop([index])

Remove and return item at index (default last).

remove(value, /)

Remove first occurrence of value.

reverse(/)

Reverse IN PLACE.

sort(*[, key, reverse])

Sort the list in ascending order and return None.

append(result)[source]

Append a bilby.core.result.Result, or set of results, to the list.

Parameters:
result: :class:`bilby.core.result.Result` or filename

pointing to a result object, to append to the list.

clear(/)

Remove all items from list.

combine(shuffle=False, consistency_level='error')[source]

Return the combined results in a :class:bilby.core.result.Result` object.

Parameters:
shuffle: bool

If true, shuffle the samples when combining, otherwise they are concatenated.

consistency_level: str, [ignore, warning, error]

Overwrite the class level consistency_level. If warning, print a warning if inconsistencies are discovered between the results. If error, raise an error if inconsistencies are discovered between the results before combining. If ignore, do nothing.

Returns:
result: bilby.core.result.Result

The combined result file

copy(/)

Return a shallow copy of the list.

count(value, /)

Return number of occurrences of value.

extend(iterable, /)

Extend list by appending elements from the iterable.

index(value, start=0, stop=sys.maxsize, /)

Return first index of value.

Raises ValueError if the value is not present.

insert(index, object, /)

Insert object before index.

pop(index=-1, /)

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(value, /)

Remove first occurrence of value.

Raises ValueError if the value is not present.

reverse(/)

Reverse IN PLACE.

sort(*, key=None, reverse=False)

Sort the list in ascending order and return None.

The sort is in-place (i.e. the list itself is modified) and stable (i.e. the order of two equal elements is maintained).

If a key function is given, apply it once to each list item and sort them, ascending or descending, according to their function values.

The reverse flag can be set to sort in descending order.