sanitize

Glotaran module with utilities for sanitation of parsed content.

Functions

Summary

convert_scientific_to_float

Convert value to float if it matches scientific notation string.

list_string_to_tuple

Convert a list of strings (representing tuples) to a list of tuples.

pretty_format_numerical

Format value with with at most decimal_places decimal places.

sanitize_dict_keys

Sanitize the stringified tuple dict keys in a yaml parsed dict.

sanitize_dict_values

Sanitizes a dict with broken tuples inside modifying it in-place.

sanitize_list_with_broken_tuples

Sanitize a list with 'broken' tuples.

sanitize_parameter_list

Replace in a list strings matching scientific notation with floats.

sanitize_yaml

Sanitize a yaml-returned dict for key or (list) values containing tuples.

sanity_scientific_notation_conversion

Convert scientific notation string values to floats.

string_to_tuple

Convert a string to a tuple if it matches a tuple pattern.