-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from chrisgilmerproj/brewhouse_yield
Add a brew house yield calculator
- Loading branch information
Showing
9 changed files
with
122 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
from .sugar import sg_to_gu | ||
|
||
__all__ = [ | ||
u'calculate_brew_house_yield', | ||
] | ||
|
||
|
||
def calculate_brew_house_yield(wort_volume, sg, grain_additions): | ||
""" | ||
Calculate Brew House Yield | ||
:param float wort_volume: The volume of the wort | ||
:param float sg: THe specific gravity of the wort | ||
:param list grain_additions: A list of grain additions in the wort | ||
:type grain_additions: list of GrainAddition objects | ||
:return: The brew house yield as a percentage | ||
Brew House Yield is a function of the wort volume, the measured specific | ||
gravity, and the grain additions used to make the wort. This equation is | ||
thrown off by use of LME or DME since both have 100% efficiency in a brew. | ||
A better measure is to look at just the grains that needed to be steeped | ||
seperately and measure the specific gravity of that process. | ||
""" | ||
total_gu = sum([grain_add.gu for grain_add in grain_additions]) | ||
return (sg_to_gu(sg) * wort_volume) / total_gu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -*- coding: utf-8 -*- | ||
import unittest | ||
|
||
from brew.utilities.efficiency import calculate_brew_house_yield | ||
from fixtures import recipe | ||
|
||
|
||
class TestEfficiencyUtilities(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.recipe = recipe | ||
|
||
def test_calculate_brew_house_yield(self): | ||
out = calculate_brew_house_yield(recipe.final_volume, | ||
recipe.og, | ||
recipe.grain_additions) | ||
self.assertEquals(round(out, 3), self.recipe.percent_brew_house_yield) |