# Path: hftools/utils.py
# def to_numeric(value, error=True):
#     """Translate string *value* to numeric type if possible
#     """
#     try:
#         return value + 0
#     except TypeError:
#         pass
#     try:
#         return int(value)
#     except ValueError:
#         try:
#             return float(value)
#         except ValueError:
#             try:
#                 if dateregexp.match(value):
#                     return np.datetime64(value)
#                 else:
#                     raise ValueError
#             except (ValueError, TypeError):
#                 if error:
#                     raise
#     return value
# 
# def isrealnumber(x):
#     return isinstance(x, (int, float))


import imp
import re
import numpy as np
import hftools.dataset
from hftools.utils import to_numeric, isrealnumber
#-----------------------------------------------------------------------------
from __future__ import unicode_literals



__all__ = ["siprefixes", "unit_to_multiplier",
           "string_number_with_unit_to_value",
           "convert_with_unit", "SIFormat"]

siprefixes = dict(d=0.1, c=0.01,
                  m=1e-03, u=1e-06, n=1e-09,
                  p=1e-12, f=1e-15, a=1e-18,
                  k=1e003, M=1e006, G=1e009,
                  T=1e012, P=1e015, E=1e018)
siprefixes[""] = 1.
si_exp_to_prefixes = {0: "",
                      3: "k", 6: "M", 9: "G", 12: "T", 15: "P",
                      18: "E", 21: "Z", -24: "Y",
                      -3: "m", -6: "u", -9: "n", -12: "p", -15: "f",
                      -18: "a", -21: "z", -24: "y"}
si_exp_to_prefixes_greek = {0: "",
                            3: "k", 6: "M", 9: "G", 12: "T", 15: "P",
                            18: "E", 21: "Z", -24: "Y",
                            -3: "m", -6: "μ", -9: "n", -12: "p", -15: "f",
                            -18: "a", -21: "z", -24: "y"}

siunit_names = ["Hz", "s", "S", "Ohm", "m", "V", "A", "F", "W"]

siunits = imp.new_module("siunits")


# Path: hftools/utils.py
# def to_numeric(value, error=True):
#     """Translate string *value* to numeric type if possible
#     """
#     try:
#         return value + 0
#     except TypeError:
#         pass
#     try:
#         return int(value)
#     except ValueError:
#         try:
#             return float(value)
#         except ValueError:
#             try:
#                 if dateregexp.match(value):
#                     return np.datetime64(value)
#                 else:
#                     raise ValueError
#             except (ValueError, TypeError):
#                 if error:
#                     raise
#     return value
# 
# def isrealnumber(x):
#     return isinstance(x, (int, float))


# Path: hftools/constants/si_units.py
import imp
import re
import numpy as np
import hftools.dataset
from hftools.utils import to_numeric, isrealnumber

#-----------------------------------------------------------------------------
from __future__ import unicode_literals



__all__ = ["siprefixes", "unit_to_multiplier",
           "string_number_with_unit_to_value",
           "convert_with_unit", "SIFormat"]

siprefixes = dict(d=0.1, c=0.01,
                  m=1e-03, u=1e-06, n=1e-09,
                  p=1e-12, f=1e-15, a=1e-18,
                  k=1e003, M=1e006, G=1e009,
                  T=1e012, P=1e015, E=1e018)
siprefixes[""] = 1.
si_exp_to_prefixes = {0: "",
                      3: "k", 6: "M", 9: "G", 12: "T", 15: "P",
                      18: "E", 21: "Z", -24: "Y",
                      -3: "m", -6: "u", -9: "n", -12: "p", -15: "f",
                      -18: "a", -21: "z", -24: "y"}
si_exp_to_prefixes_greek = {0: "",
                            3: "k", 6: "M", 9: "G", 12: "T", 15: "P",
                            18: "E", 21: "Z", -24: "Y",
                            -3: "m", -6: "μ", -9: "n", -12: "p", -15: "f",
                            -18: "a", -21: "z", -24: "y"}

siunit_names = ["Hz", "s", "S", "Ohm", "m", "V", "A", "F", "W"]

siunits = imp.new_module("siunits")


for u in siunit_names: