# Path: gridsim/decorators.py
# def accepts(*atypes):
#     """
#     accepts()
# 
#     Type Enforcement. Verifies types of parameters given to the function.
#     
#     *Example:*
#     ::
# 
#         @accepts((0,int), (1,(int,float)))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     .. warning::
#         In a class function, the current class cannot be used (e.g.: ``self``
#         type cannot be defined with ``accepts``)
#     """
# 
#     if __debug__:
#         def check_accepts(func):
# 
#             @wraps(func)
#             def new_func(*args, **keywords):
# 
#                 if len(atypes) != 0 and type(atypes[0]) is not tuple:
#                     raise AttributeError("Missing brackets in accepts of function "
#                                          + func.__name__)
# 
#                 for atype in atypes:
# 
#                     if type(atype[0]) is tuple:
#                         for apos in atype[0]:
# 
#                             default_param = False
#                             try:
#                                 args[apos]
#                             except IndexError:
#                                 default_param = True
# 
#                             if not default_param \
#                                     and not isinstance(args[apos], atype[1]):
#                                 raise TypeError(
#                                     "In '"+func.__name__+"', "
#                                     "params value %r does not "
#                                     "match %s" % (args[apos], atype[1]))
#                     else:
# 
#                         default_param = False
#                         try:
#                             args[atype[0]]
#                         except IndexError:
#                             default_param = True
# 
#                         if not default_param \
#                                 and not isinstance(args[atype[0]], atype[1]):
#                             raise TypeError(
#                                 "In"+func.__name__+", "
#                                 "params value %r does not "
#                                 "match %s" % (args[atype[0]], atype[1]))
# 
#                 return func(*args, **keywords)
# 
#             return new_func
#     else:
#         def check_accepts(func):
#             return func
# 
#     return check_accepts
# 
# def returns(rtype=type(None)):
#     """
#     returns()
# 
#     Type Enforcement. Verifies return type of the function.
#     
#     *Example:*
#     ::
# 
#         @returns((int,float))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     """
#     if __debug__:
#         def check_returns(func):
# 
#             @wraps(func)
#             def new_f(*args, **keywords):
# 
#                 result = func(*args, **keywords)
#                 if not isinstance(result, rtype):
#                     raise TypeError(
#                         "return value %r does not match %s" % (result, rtype))
#                 return result
# 
#             return new_f
#     else:
#         def check_returns(func):
#             return func
# 
#     return check_returns
# 
# Path: gridsim/unit.py
# class _Unit(object):
#     def __init__(self):
#     def Quantity(self):
#     def Unit(self):
#     def __call__(self, *args, **kwargs):
#     def __getattr__(self, item):
#     def to_si(self, measurement_or_unit):
#     def value(self, measurement, unit=None):
#     def unit(self, measurement):
#     def dimension(self, measurement):
#     def convert(self, m, u):


import types
import math
from .decorators import accepts, returns
from .unit import units
        __init__(self, c, p, k)

        .. warning:: This class cannot be instanced directly. Use sub classes instead.
                     Each Material must inherit this class.

        This class offer simple access to constants of materials.

        *Example*::

            >>> from gridsim.util import Air
            >>> print Air().thermal_conductivity
            0.02587 thermal_conductivity

        With ``thermal_conductivity`` is ``W/Km``, see :mod:`gridsim.unit`
        for more information.

        :param c: The thermal capacity in ``J/kgK``.
        :type c: int, float
        :param p: The weight of the material in ``g/m3``.
        :type p: int, float
        :param k: The thermal conductivity in ``W/Km``.
        :type k: int, float
        :return:
        """

        super(Material, self).__init__()

        if c is None:
            self._c = None
        else:

# Path: gridsim/decorators.py
# def accepts(*atypes):
#     """
#     accepts()
# 
#     Type Enforcement. Verifies types of parameters given to the function.
#     
#     *Example:*
#     ::
# 
#         @accepts((0,int), (1,(int,float)))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     .. warning::
#         In a class function, the current class cannot be used (e.g.: ``self``
#         type cannot be defined with ``accepts``)
#     """
# 
#     if __debug__:
#         def check_accepts(func):
# 
#             @wraps(func)
#             def new_func(*args, **keywords):
# 
#                 if len(atypes) != 0 and type(atypes[0]) is not tuple:
#                     raise AttributeError("Missing brackets in accepts of function "
#                                          + func.__name__)
# 
#                 for atype in atypes:
# 
#                     if type(atype[0]) is tuple:
#                         for apos in atype[0]:
# 
#                             default_param = False
#                             try:
#                                 args[apos]
#                             except IndexError:
#                                 default_param = True
# 
#                             if not default_param \
#                                     and not isinstance(args[apos], atype[1]):
#                                 raise TypeError(
#                                     "In '"+func.__name__+"', "
#                                     "params value %r does not "
#                                     "match %s" % (args[apos], atype[1]))
#                     else:
# 
#                         default_param = False
#                         try:
#                             args[atype[0]]
#                         except IndexError:
#                             default_param = True
# 
#                         if not default_param \
#                                 and not isinstance(args[atype[0]], atype[1]):
#                             raise TypeError(
#                                 "In"+func.__name__+", "
#                                 "params value %r does not "
#                                 "match %s" % (args[atype[0]], atype[1]))
# 
#                 return func(*args, **keywords)
# 
#             return new_func
#     else:
#         def check_accepts(func):
#             return func
# 
#     return check_accepts
# 
# def returns(rtype=type(None)):
#     """
#     returns()
# 
#     Type Enforcement. Verifies return type of the function.
#     
#     *Example:*
#     ::
# 
#         @returns((int,float))
#         def func(arg1, arg2):
#             return arg1 * arg2
# 
#     """
#     if __debug__:
#         def check_returns(func):
# 
#             @wraps(func)
#             def new_f(*args, **keywords):
# 
#                 result = func(*args, **keywords)
#                 if not isinstance(result, rtype):
#                     raise TypeError(
#                         "return value %r does not match %s" % (result, rtype))
#                 return result
# 
#             return new_f
#     else:
#         def check_returns(func):
#             return func
# 
#     return check_returns
# 
# Path: gridsim/unit.py
# class _Unit(object):
#     def __init__(self):
#     def Quantity(self):
#     def Unit(self):
#     def __call__(self, *args, **kwargs):
#     def __getattr__(self, item):
#     def to_si(self, measurement_or_unit):
#     def value(self, measurement, unit=None):
#     def unit(self, measurement):
#     def dimension(self, measurement):
#     def convert(self, m, u):


# Path: gridsim/util.py
import types
import math
from .decorators import accepts, returns
from .unit import units

        __init__(self, c, p, k)

        .. warning:: This class cannot be instanced directly. Use sub classes instead.
                     Each Material must inherit this class.

        This class offer simple access to constants of materials.

        *Example*::

            >>> from gridsim.util import Air
            >>> print Air().thermal_conductivity
            0.02587 thermal_conductivity

        With ``thermal_conductivity`` is ``W/Km``, see :mod:`gridsim.unit`
        for more information.

        :param c: The thermal capacity in ``J/kgK``.
        :type c: int, float
        :param p: The weight of the material in ``g/m3``.
        :type p: int, float
        :param k: The thermal conductivity in ``W/Km``.
        :type k: int, float
        :return:
        """

        super(Material, self).__init__()

        if c is None:
            self._c = None
        else:

            self._c = c*units.heat_capacity