Beispiel #1
0
    def __call__(self, *args, **kwargs):
        def _is_float(value):
            return isinstance(value, (float, np.floating))

        return self.str_template.format(
            *[format_float(i) if _is_float(i) else i for i in args], **{
                k: format_float(v) if _is_float(v) else v
                for k, v in kwargs.items()
            })
Beispiel #2
0
def format_arg(value):
    if np.isnan(value):
        return "NaN"

    return format_float(value)