# Path: brew/constants.py
# HOP_TYPE_PELLET = u"pellet"
# 
# Path: brew/constants.py
# HOP_TYPE_PLUG = u"plug"
# 
# Path: brew/constants.py
# HOP_TYPE_WHOLE = u"whole"
# 
# Path: brew/constants.py
# HOP_TYPE_WHOLE_WET = u"whole wet"
# 
# Path: brew/constants.py
# HOP_UTILIZATION_SCALE_PELLET = 1.1  # 110%
# 
# Path: brew/constants.py
# HOP_WHOLE_DRY_TO_WET = 5.5
# 
# Path: brew/constants.py
# HOPS_CONSTANT_IMPERIAL = MG_PER_OZ * GAL_PER_LITER
# 
# Path: brew/constants.py
# HOPS_CONSTANT_SI = 1.0
# 
# Path: brew/constants.py
# IMPERIAL_TYPES = {
#     u"volume": u"gallon",
#     u"weight_large": u"lbs",
#     u"weight_small": u"oz",
#     u"temperature": u"degF",
# }
# 
# Path: brew/constants.py
# IMPERIAL_UNITS = u"imperial"
# 
# Path: brew/constants.py
# SI_TYPES = {
#     u"volume": u"liter",
#     u"weight_large": u"kg",
#     u"weight_small": u"mg",
#     u"temperature": u"degC",
# }
# 
# Path: brew/constants.py
# SI_UNITS = u"metric"
# 
# Path: brew/validators.py
# def validate_units(units):
#     """
#     Validate units
# 
#     :param str units: Unit type
#     :return: units
#     :rtype: str
#     :raises ValidatorException: If units is unknown
#     """
#     if units in [IMPERIAL_UNITS, SI_UNITS]:
#         return units
#     raise ValidatorException(
#         u"Unkown units '{}', must use {} or {}".format(units, IMPERIAL_UNITS, SI_UNITS)
#     )


import math
from ..constants import HOP_TYPE_PELLET
from ..constants import HOP_TYPE_PLUG
from ..constants import HOP_TYPE_WHOLE
from ..constants import HOP_TYPE_WHOLE_WET
from ..constants import HOP_UTILIZATION_SCALE_PELLET
from ..constants import HOP_WHOLE_DRY_TO_WET
from ..constants import HOPS_CONSTANT_IMPERIAL
from ..constants import HOPS_CONSTANT_SI
from ..constants import IMPERIAL_TYPES
from ..constants import IMPERIAL_UNITS
from ..constants import SI_TYPES
from ..constants import SI_UNITS
from ..validators import validate_units
            self.types = SI_TYPES

    def change_units(self):
        """
        Change units of the class from one type to the other

        :return: Hop Addition in new unit type
        :rtype: HopAddition
        """
        if self.units == IMPERIAL_UNITS:
            units = SI_UNITS
        elif self.units == SI_UNITS:
            units = IMPERIAL_UNITS
        return HopsUtilization(self.hop_addition, units=units)

    def get_ibus(self, sg, final_volume):
        """
        Get the IBUs

        :param float sg: Specific Gravity
        :param float final_volume: The Final Volume of the wort
        :return: The IBUs of the wort
        :rtype: float
        """
        hops_constant = HOPS_CONSTANT_IMPERIAL
        if self.units == SI_UNITS:
            hops_constant = HOPS_CONSTANT_SI
        utilization = self.get_percent_utilization(sg, self.hop_addition.boil_time)
        # Hop weight for wet is greater than dry
        hop_weight = self.hop_addition.weight

# Path: brew/constants.py
# HOP_TYPE_PELLET = u"pellet"
# 
# Path: brew/constants.py
# HOP_TYPE_PLUG = u"plug"
# 
# Path: brew/constants.py
# HOP_TYPE_WHOLE = u"whole"
# 
# Path: brew/constants.py
# HOP_TYPE_WHOLE_WET = u"whole wet"
# 
# Path: brew/constants.py
# HOP_UTILIZATION_SCALE_PELLET = 1.1  # 110%
# 
# Path: brew/constants.py
# HOP_WHOLE_DRY_TO_WET = 5.5
# 
# Path: brew/constants.py
# HOPS_CONSTANT_IMPERIAL = MG_PER_OZ * GAL_PER_LITER
# 
# Path: brew/constants.py
# HOPS_CONSTANT_SI = 1.0
# 
# Path: brew/constants.py
# IMPERIAL_TYPES = {
#     u"volume": u"gallon",
#     u"weight_large": u"lbs",
#     u"weight_small": u"oz",
#     u"temperature": u"degF",
# }
# 
# Path: brew/constants.py
# IMPERIAL_UNITS = u"imperial"
# 
# Path: brew/constants.py
# SI_TYPES = {
#     u"volume": u"liter",
#     u"weight_large": u"kg",
#     u"weight_small": u"mg",
#     u"temperature": u"degC",
# }
# 
# Path: brew/constants.py
# SI_UNITS = u"metric"
# 
# Path: brew/validators.py
# def validate_units(units):
#     """
#     Validate units
# 
#     :param str units: Unit type
#     :return: units
#     :rtype: str
#     :raises ValidatorException: If units is unknown
#     """
#     if units in [IMPERIAL_UNITS, SI_UNITS]:
#         return units
#     raise ValidatorException(
#         u"Unkown units '{}', must use {} or {}".format(units, IMPERIAL_UNITS, SI_UNITS)
#     )


# Path: brew/utilities/hops.py
import math
from ..constants import HOP_TYPE_PELLET
from ..constants import HOP_TYPE_PLUG
from ..constants import HOP_TYPE_WHOLE
from ..constants import HOP_TYPE_WHOLE_WET
from ..constants import HOP_UTILIZATION_SCALE_PELLET
from ..constants import HOP_WHOLE_DRY_TO_WET
from ..constants import HOPS_CONSTANT_IMPERIAL
from ..constants import HOPS_CONSTANT_SI
from ..constants import IMPERIAL_TYPES
from ..constants import IMPERIAL_UNITS
from ..constants import SI_TYPES
from ..constants import SI_UNITS
from ..validators import validate_units

            self.types = SI_TYPES

    def change_units(self):
        """
        Change units of the class from one type to the other

        :return: Hop Addition in new unit type
        :rtype: HopAddition
        """
        if self.units == IMPERIAL_UNITS:
            units = SI_UNITS
        elif self.units == SI_UNITS:
            units = IMPERIAL_UNITS
        return HopsUtilization(self.hop_addition, units=units)

    def get_ibus(self, sg, final_volume):
        """
        Get the IBUs

        :param float sg: Specific Gravity
        :param float final_volume: The Final Volume of the wort
        :return: The IBUs of the wort
        :rtype: float
        """
        hops_constant = HOPS_CONSTANT_IMPERIAL
        if self.units == SI_UNITS:
            hops_constant = HOPS_CONSTANT_SI
        utilization = self.get_percent_utilization(sg, self.hop_addition.boil_time)
        # Hop weight for wet is greater than dry
        hop_weight = self.hop_addition.weight

        if self.hop_addition.hop_type == HOP_TYPE_WHOLE_WET: