mirror of
https://github.com/shouptech/humulus.git
synced 2026-02-03 14:59:43 +00:00
parent
3e79dd086f
commit
c128d78f5f
2 changed files with 4 additions and 2 deletions
|
|
@ -70,6 +70,8 @@ def recipe_ibu(recipe):
|
|||
bigness = 1.65 * 0.000125**(float(recipe_og(recipe)) - 1)
|
||||
ibu = 0.0
|
||||
for h in recipe['hops']:
|
||||
if h['use'] != 'Boil' and h['use'] != 'FWH':
|
||||
continue
|
||||
mgl = (
|
||||
float(h['alpha']) * float(h['amount']) * 7490.0 /
|
||||
(float(recipe['volume']) * 100.0)
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ def test_recipe_fg(sample_recipes):
|
|||
|
||||
|
||||
def test_recipe_ibu(sample_recipes):
|
||||
assert recipe_ibu(sample_recipes['lager']) == '26'
|
||||
assert recipe_ibu(sample_recipes['lager']) == '24'
|
||||
assert recipe_ibu(sample_recipes['sweetstout']) == '34'
|
||||
# Remove hops, verify 0 is returned
|
||||
sample_recipes['lager'].pop('hops')
|
||||
|
|
@ -44,7 +44,7 @@ def test_recipe_ibu(sample_recipes):
|
|||
|
||||
|
||||
def test_recipe_ibu_ratio(sample_recipes):
|
||||
assert recipe_ibu_ratio(sample_recipes['lager']) == '0.48'
|
||||
assert recipe_ibu_ratio(sample_recipes['lager']) == '0.44'
|
||||
assert recipe_ibu_ratio(sample_recipes['sweetstout']) == '0.89'
|
||||
# Remove fermentables, verify 0 is returned
|
||||
sample_recipes['lager'].pop('fermentables')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue