# Path: brew/utilities/temperature.py
# def boiling_point(altitude):
#     """
#     Get the boiling point at a specific altitude
# 
#     https://www.omnicalculator.com/chemistry/boiling-point-altitude
# 
#     :param float altitude: Altitude in feet (ft)
#     :return: The boiling point in degF
#     :rtype: float
#     """
# 
#     pressure = 29.921 * pow((1 - 0.0000068753 * altitude), 5.2559)
#     boiling_point = 49.161 * math.log(pressure) + 44.932
#     return boiling_point
# 
# Path: brew/utilities/temperature.py
# def celsius_to_fahrenheit(temp):
#     """
#     Convert degrees Celsius to degrees Fahrenheit
# 
#     :param float temp: The temperature in Celsius
#     :return: The temperature in Fahrenheit
#     :rtype: float
#     """
#     return (temp * 1.8) + 32.0
# 
# Path: brew/utilities/temperature.py
# def fahrenheit_to_celsius(temp):
#     """
#     Convert degrees Fahrenheit to degrees Celsius
# 
#     :param float temp: The temperature in Fahrenheit
#     :return: The temperature in Celsius
#     :rtype: float
#     """
#     return (temp - 32.0) / 1.8
# 
# Path: brew/utilities/temperature.py
# def mash_infusion(
#     target_temp, initial_temp, grain_weight, water_volume, infusion_temp=212
# ):
#     """
#     Get Volume of water to infuse into mash to reach scheduled temperature
# 
#     All temperatures in F.
# 
#     http://howtobrew.com/book/section-3/the-methods-of-mashing/calculations-for-boiling-water-additions
# 
#     :param float target_temp: Mash Temperature to Achieve
#     :param float inital_temp: Mash Temperature
#     :param float grain_weight: Total weight of grain in mash (lbs)
#     :param float water_volume: Total volume of water in mash (qt)
#     :param float infusion_temp: Temperature of water to infuse
#     :return: The volume of water to add to the mash (qt)
#     :rtype: float
#     """
#     return (
#         (target_temp - initial_temp)
#         * (0.2 * grain_weight + water_volume)
#         / (infusion_temp - target_temp)
#     )
# 
# Path: brew/utilities/temperature.py
# def strike_temp(target_temp, initial_temp, liquor_to_grist_ratio=1.5):
#     """
#     Get Strike Water Temperature
# 
#     All temperatures in F.
# 
#     http://howtobrew.com/book/section-3/the-methods-of-mashing/calculations-for-boiling-water-additions
# 
#     :param float target_temp: Mash Temperature to Achieve
#     :param float initial_temp: Malt Temperature
#     :param float liquor_to_grist_ratio: The Liquor to Grist Ratio (qt:lbs)
#     :return: The strike water temperature
#     :rtype: float
#     """  # noqa
#     return (0.2 / liquor_to_grist_ratio) * (target_temp - initial_temp) + target_temp


import unittest
from brew.utilities.temperature import boiling_point
from brew.utilities.temperature import celsius_to_fahrenheit
from brew.utilities.temperature import fahrenheit_to_celsius
from brew.utilities.temperature import mash_infusion
from brew.utilities.temperature import strike_temp
# -*- coding: utf-8 -*-



class TestTemperatureUtilities(unittest.TestCase):
    def test_celsius_to_fahrenheit(self):
        ftemp = celsius_to_fahrenheit(100.0)
        self.assertEquals(ftemp, 212.0)
        ftemp = celsius_to_fahrenheit(0.0)
        self.assertEquals(ftemp, 32.0)

# Path: brew/utilities/temperature.py
# def boiling_point(altitude):
#     """
#     Get the boiling point at a specific altitude
# 
#     https://www.omnicalculator.com/chemistry/boiling-point-altitude
# 
#     :param float altitude: Altitude in feet (ft)
#     :return: The boiling point in degF
#     :rtype: float
#     """
# 
#     pressure = 29.921 * pow((1 - 0.0000068753 * altitude), 5.2559)
#     boiling_point = 49.161 * math.log(pressure) + 44.932
#     return boiling_point
# 
# Path: brew/utilities/temperature.py
# def celsius_to_fahrenheit(temp):
#     """
#     Convert degrees Celsius to degrees Fahrenheit
# 
#     :param float temp: The temperature in Celsius
#     :return: The temperature in Fahrenheit
#     :rtype: float
#     """
#     return (temp * 1.8) + 32.0
# 
# Path: brew/utilities/temperature.py
# def fahrenheit_to_celsius(temp):
#     """
#     Convert degrees Fahrenheit to degrees Celsius
# 
#     :param float temp: The temperature in Fahrenheit
#     :return: The temperature in Celsius
#     :rtype: float
#     """
#     return (temp - 32.0) / 1.8
# 
# Path: brew/utilities/temperature.py
# def mash_infusion(
#     target_temp, initial_temp, grain_weight, water_volume, infusion_temp=212
# ):
#     """
#     Get Volume of water to infuse into mash to reach scheduled temperature
# 
#     All temperatures in F.
# 
#     http://howtobrew.com/book/section-3/the-methods-of-mashing/calculations-for-boiling-water-additions
# 
#     :param float target_temp: Mash Temperature to Achieve
#     :param float inital_temp: Mash Temperature
#     :param float grain_weight: Total weight of grain in mash (lbs)
#     :param float water_volume: Total volume of water in mash (qt)
#     :param float infusion_temp: Temperature of water to infuse
#     :return: The volume of water to add to the mash (qt)
#     :rtype: float
#     """
#     return (
#         (target_temp - initial_temp)
#         * (0.2 * grain_weight + water_volume)
#         / (infusion_temp - target_temp)
#     )
# 
# Path: brew/utilities/temperature.py
# def strike_temp(target_temp, initial_temp, liquor_to_grist_ratio=1.5):
#     """
#     Get Strike Water Temperature
# 
#     All temperatures in F.
# 
#     http://howtobrew.com/book/section-3/the-methods-of-mashing/calculations-for-boiling-water-additions
# 
#     :param float target_temp: Mash Temperature to Achieve
#     :param float initial_temp: Malt Temperature
#     :param float liquor_to_grist_ratio: The Liquor to Grist Ratio (qt:lbs)
#     :return: The strike water temperature
#     :rtype: float
#     """  # noqa
#     return (0.2 / liquor_to_grist_ratio) * (target_temp - initial_temp) + target_temp


# Path: tests/test_utilities_temperature.py
import unittest
from brew.utilities.temperature import boiling_point
from brew.utilities.temperature import celsius_to_fahrenheit
from brew.utilities.temperature import fahrenheit_to_celsius
from brew.utilities.temperature import mash_infusion
from brew.utilities.temperature import strike_temp

# -*- coding: utf-8 -*-



class TestTemperatureUtilities(unittest.TestCase):
    def test_celsius_to_fahrenheit(self):
        ftemp = celsius_to_fahrenheit(100.0)
        self.assertEquals(ftemp, 212.0)
        ftemp = celsius_to_fahrenheit(0.0)
        self.assertEquals(ftemp, 32.0)

        ftemp = celsius_to_fahrenheit(-40.0)