formatter

sf3dmodels.tools.formatter(prop_keys, fmt='%.6e', base='', default='%.6e')[source] [edit on github]

Formatter function for a given set of properties.

Parameters:
fmt : str or dict, optional

If str: Format string for all the columns. Defaults to ‘%.6e’.

If dict: the input keys of the dictionary must be present in the prop_keys list. The keys from prop_keys which were not specified in the fmt dict, will return the default format default.

base : str, optional

Preceding format(s) to the final-computed format string. Defaults to None.

default : str, optional

Default format for non-specified keys if fmt is dict.

Returns:
fmt_string : str

String with the computed set of formats, to be used on output prints or files.