sanitize_list_with_broken_tuples

glotaran.utils.sanitize.sanitize_list_with_broken_tuples(mangled_list: list[str | float]) list[str][source]

Sanitize a list with ‘broken’ tuples.

A list of broken tuples as returned by yaml when parsing tuples. e.g parsing the list of tuples [(3,100), (4,200)] results in a list of str [‘(3’, ‘100)’, ‘(4’, ‘200)’] which can be restored to a list with the tuples restored as strings [‘(3, 100)’, ‘(4, 200)’]

Parameters:

mangled_list (List[Union[str,float]]) – A list with strings representing tuples broken up by round brackets.

Returns:

A list containing the restores tuples (in string form) which can be converted back to numbered tuples using list_string_to_tuple

Return type:

List[str]