# Path: brew/utilities/malt.py
# def sg_from_dry_basis(
#     dbcg,
#     moisture_content=MOISTURE_FINISHED_MALT,
#     moisture_correction=MOISTURE_CORRECTION,
#     brew_house_efficiency=0.90,
# ):
#     """
#     Specific Gravity from Dry Basis Percentage
# 
#     :param float dbcg: Dry Basis Coarse Grain in decimal form
#     :param float moisture_content: A percentage of moisture content in finished malt in decimal form
#     :param float moisture_correction: A percentage correction in decimal form
#     :param float brew_house_efficiency: The efficiency in decimal form
#     :return: Specific Gravity available from Malt
#     :rtype: float
#     """  # noqa
#     validate_percentage(dbcg)
#     validate_percentage(moisture_content)
#     validate_percentage(moisture_correction)
#     validate_percentage(brew_house_efficiency)
#     gu = (
#         (dbcg - moisture_content - moisture_correction)
#         * brew_house_efficiency
#         * SUCROSE_PPG
#     )
#     return gu_to_sg(gu)
# 
# Path: brew/utilities/sugar.py
# def sg_to_gu(sg):
#     """
#     Specific Gravity to Gravity Units
# 
#     :param float sg: Specific Gravity
#     :return: Gravity Units
#     :rtype: float
#     """
#     return (sg - 1) * 1000.0


from brew.utilities.malt import sg_from_dry_basis
from brew.utilities.sugar import sg_to_gu
#! /usr/bin/env python



"""
Ray Daniels
Designing Great Beers

Appendix 2: Course Grind Potential Extract (modified)

Notes:
    The chart appears to have been developed with the moisture content set
    to zero (0.0) and the Brew House Efficiency set to 100% (1.0).  This
    is not typical and the book even states that you should expect moisture
    content at around 4.0% and Brew House Efficiency at arount 90.0%.

This version has been modified with more typical values.
"""


def get_chart():
    mc = 0.04
    bhe = 0.9

    chart = []
    for dbcg in range(5000, 7600, 100) + range(7600, 8025, 25):
        sg = sg_from_dry_basis(
            dbcg / 10000.0, moisture_content=mc, brew_house_efficiency=bhe
        )

# Path: brew/utilities/malt.py
# def sg_from_dry_basis(
#     dbcg,
#     moisture_content=MOISTURE_FINISHED_MALT,
#     moisture_correction=MOISTURE_CORRECTION,
#     brew_house_efficiency=0.90,
# ):
#     """
#     Specific Gravity from Dry Basis Percentage
# 
#     :param float dbcg: Dry Basis Coarse Grain in decimal form
#     :param float moisture_content: A percentage of moisture content in finished malt in decimal form
#     :param float moisture_correction: A percentage correction in decimal form
#     :param float brew_house_efficiency: The efficiency in decimal form
#     :return: Specific Gravity available from Malt
#     :rtype: float
#     """  # noqa
#     validate_percentage(dbcg)
#     validate_percentage(moisture_content)
#     validate_percentage(moisture_correction)
#     validate_percentage(brew_house_efficiency)
#     gu = (
#         (dbcg - moisture_content - moisture_correction)
#         * brew_house_efficiency
#         * SUCROSE_PPG
#     )
#     return gu_to_sg(gu)
# 
# Path: brew/utilities/sugar.py
# def sg_to_gu(sg):
#     """
#     Specific Gravity to Gravity Units
# 
#     :param float sg: Specific Gravity
#     :return: Gravity Units
#     :rtype: float
#     """
#     return (sg - 1) * 1000.0


# Path: charts/ray_daniels/designing_great_beers/appendix_two_course_grind_potential_extract_modified.py
from brew.utilities.malt import sg_from_dry_basis
from brew.utilities.sugar import sg_to_gu

#! /usr/bin/env python



"""
Ray Daniels
Designing Great Beers

Appendix 2: Course Grind Potential Extract (modified)

Notes:
    The chart appears to have been developed with the moisture content set
    to zero (0.0) and the Brew House Efficiency set to 100% (1.0).  This
    is not typical and the book even states that you should expect moisture
    content at around 4.0% and Brew House Efficiency at arount 90.0%.

This version has been modified with more typical values.
"""


def get_chart():
    mc = 0.04
    bhe = 0.9

    chart = []
    for dbcg in range(5000, 7600, 100) + range(7600, 8025, 25):
        sg = sg_from_dry_basis(
            dbcg / 10000.0, moisture_content=mc, brew_house_efficiency=bhe
        )

        gu = sg_to_gu(sg)