# Path: temci/utils/util.py
# def document(**kwargs: t.Dict[str, str]):
#     """
#     Document
# 
#     :param kwargs: class attribute, documentation prefix
#     """
# 
#     def dec(klass):
#         if sphinx_doc():
#             for k, v in kwargs.items():
#                 klass.__doc__ += """
# 
#     {}
# 
#     {}
# 
#                 """.format(v, get_doc_for_type_scheme(klass.__dict__[k]))
#         return klass
# 
#     return dec


import sys
import typing as t
import math
from enum import Enum
from temci.utils.typecheck import *
from temci.utils.util import document
        from temci.utils.settings import Settings


Number = t.Union[int, float]
""" Numeric type """


def fnumber(number: Number, rel_deviation: Number = None, abs_deviation: Number = None, is_percent: bool = False) -> str:
    return FNumber(number, rel_deviation, abs_deviation, is_percent).format()


class ParenthesesMode(Enum):

    DIGIT_CHANGE = "d"
    ORDER_OF_MAGNITUDE = "o"

    @classmethod
    def map(cls, key: t.Union[str, 'ParenthesesMode']) -> 'ParenthesesMode':
        if isinstance(key, ParenthesesMode):
            return key
        return {
            "d": ParenthesesMode.DIGIT_CHANGE,
            "o": ParenthesesMode.ORDER_OF_MAGNITUDE
        }[key]



# Path: temci/utils/util.py
# def document(**kwargs: t.Dict[str, str]):
#     """
#     Document
# 
#     :param kwargs: class attribute, documentation prefix
#     """
# 
#     def dec(klass):
#         if sphinx_doc():
#             for k, v in kwargs.items():
#                 klass.__doc__ += """
# 
#     {}
# 
#     {}
# 
#                 """.format(v, get_doc_for_type_scheme(klass.__dict__[k]))
#         return klass
# 
#     return dec


# Path: temci/utils/number.py
import sys
import typing as t
import math
from enum import Enum
from temci.utils.typecheck import *
from temci.utils.util import document
        from temci.utils.settings import Settings



Number = t.Union[int, float]
""" Numeric type """


def fnumber(number: Number, rel_deviation: Number = None, abs_deviation: Number = None, is_percent: bool = False) -> str:
    return FNumber(number, rel_deviation, abs_deviation, is_percent).format()


class ParenthesesMode(Enum):

    DIGIT_CHANGE = "d"
    ORDER_OF_MAGNITUDE = "o"

    @classmethod
    def map(cls, key: t.Union[str, 'ParenthesesMode']) -> 'ParenthesesMode':
        if isinstance(key, ParenthesesMode):
            return key
        return {
            "d": ParenthesesMode.DIGIT_CHANGE,
            "o": ParenthesesMode.ORDER_OF_MAGNITUDE
        }[key]



@document(settings_format="Configuration format, is in the settings under report/number")