def main(): recipe = { u'name': u"Lunar Eclipse Red (Extract)", u'start_volume': 4.0, u'final_volume': 5.0, u'grains': [ { u'name': u'Pale Liquid Extract', u'weight': 6.0 + (15.0 + 3.0 / 8.0) / 16 - (3.0 + 1.0 / 8.0) / 16, u'grain_type': u'lme' }, { u'name': u'Munich Malt', u'weight': 1.0, u'grain_type': u'specialty' }, { u'name': u'Caramel Crystal Malt 10l', u'weight': 1.0, u'grain_type': u'specialty' }, { u'name': u'Caramel Crystal Malt 60l', u'weight': 1.0, u'grain_type': u'specialty' }, { u'name': u'Caramel Crystal Malt 80l', u'weight': 1.0, u'grain_type': u'specialty' }, ], u'hops': [ { u'name': u'Chinook', u'weight': 1.0, u'boil_time': 60.0 }, { u'name': u'Chinook', u'weight': 1.0, u'boil_time': 15.0 }, ], u'yeast': { u'name': u'Wyeast 1084', }, u'data': { u'brew_house_yield': 0.4396, u'units': u'imperial', }, } data_dir = os.path.abspath(os.path.join(os.getcwd(), 'data/')) loader = JSONDataLoader(data_dir) beer = parse_recipe(recipe, loader) print(beer.format(short=True)) # BIAB Measurement 1.017, volume reduced by 0.4 Gallons # This is before adding extract to volume but after grains were removed grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(3.62, 1.017, grain_additions) print("\nBrew House Yield: {:0.2%} (Specialty Grains BIAB)".format(bhy)) # Measurement 1.078, measured right after addition of extract bhy = calculate_brew_house_yield(3.62, 1.078, beer.grain_additions) print("\nBrew House Yield: {:0.2%} (Pre-Boil, after extract addition)". format(bhy)) # noqa # Measurement 1.082, volume reduced by 0.6 # # 1.082 Refractometer # # 22, 11.2%, 1088.0 @ 69deg bhy = calculate_brew_house_yield(3.41, 1.082, beer.grain_additions) print("\nBrew House Yield: {:0.2%} (After Boil, before water addition)". format(bhy)) # noqa # Final Measurement 1.053, add water up to 5.0 Gallons bhy = calculate_brew_house_yield(5.0, 1.053, beer.grain_additions) print("\nBrew House Yield: {:0.2%} (Total Beer)".format(bhy))
def main(): recipe = { u'name': u"Yellow Moon IPA (Extract)", u'start_volume': 4.0, u'final_volume': 5.0, u'grains': [ { u'name': u'Pale Liquid Extract', u'weight': 7.0, u'grain_type': u'lme' }, { u'name': u'Caramel Crystal Malt 20l', u'weight': 1.0, u'grain_type': u'specialty' }, { u'name': u'Munich Malt', u'weight': 0.5, u'grain_type': u'specialty' }, { u'name': u'Cara Pils Dextrine', u'weight': 0.5, u'grain_type': u'specialty' }, ], u'hops': [ { u'name': u'Centennial', u'weight': 1.0, u'boil_time': 60.0 }, { u'name': u'Centennial', u'weight': 1.0, u'boil_time': 30.0 }, { u'name': u'Cascade US', u'weight': 1.0, u'boil_time': 10.0 }, { u'name': u'Cascade US', u'weight': 1.0, u'boil_time': 0.0 }, ], u'yeast': { u'name': u'Wyeast 1056', }, u'data': { u'brew_house_yield': 0.425, u'units': u'imperial', }, } data_dir = os.path.abspath(os.path.join(os.getcwd(), 'data/')) loader = JSONDataLoader(data_dir) beer = parse_recipe(recipe, loader) print(beer.format(short=True)) factory = StyleFactory(os.path.join(data_dir, 'bjcp', 'styles.json')) style = factory.create_style('21', 'A') print("") print(style.format()) print('Style issues:') errors = style.recipe_errors(beer) for err in errors: print('- {}'.format(err)) print('') builder = RecipeBuilder( name='Pale Ale', grain_list=[g.grain for g in beer.grain_additions], hop_list=[h.hop for h in beer.hop_additions], target_ibu=54.6, target_og=1.060, brew_house_yield=0.50, start_volume=4.0, final_volume=5.0, ) percent_list = [0.9, 0.05, 0.025, 0.025] grain_additions = builder.get_grain_additions(percent_list) for grain_add in grain_additions: print(grain_add.convert_to_lme(0.50).format()) print('') # BIAB Measurement 1.0085, volume reduced by 0.5 Gallons # This is before adding extract to volume but after grains were removed grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(3.5, 1.0085, grain_additions) print("\nBrew House Yield: {:0.2%} (Specialty Grains BIAB)".format(bhy)) # After extract added # This is before adding extract to volume but after grains were removed bhy = calculate_brew_house_yield(3.5, 1.075, beer.grain_additions) print("\nBrew House Yield: {:0.2%} (After extract addition)".format(bhy)) lbs_dme = beer.get_wort_correction(75, 3.5) print("\nAdd {:0.2f} lbs of DME to fix wort".format(lbs_dme))
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.brew_house_yield)
def main(): recipe = { u'name': u"Scottish Amber (Extract)", u'start_volume': 5.0, u'final_volume': 5.0, u'grains': [ {u'name': u'Pale Liquid Extract', u'weight': 7.0 + (1.125 / 16) - (3.25 / 16.0), # Remove container u'grain_type': u'lme'}, {u'name': u'Caramel Crystal Malt 80l', u'weight': 1.04, u'grain_type': u'specialty'}, {u'name': u'Smoked Malt', # Rausch means "Smoked" u'weight': 1.04, u'data': { u'color': 6.0}, u'grain_type': u'specialty'}, {u'name': u'Victory Malt', u'weight': 1.04, u'grain_type': u'specialty'}, ], u'hops': [ {u'name': u'Perle', u'weight': 1.0, u'boil_time': 60.0}, {u'name': u'Perle', u'weight': 1.0, u'boil_time': 30.0}, ], u'yeast': { u'name': u'Wyeast 1728', }, u'data': { u'brew_house_yield': 0.458, u'units': u'imperial', }, } data_dir = os.path.abspath(os.path.join(os.getcwd(), 'data/')) loader = JSONDataLoader(data_dir) beer = parse_recipe(recipe, loader) print(beer.format(short=True)) # Refractometer needed to be calibrated REF_ADJ = 0.005 # BIAB Measurement # This is before removing grains from mash water grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(1.0, 1.048 + REF_ADJ, grain_additions) print("\nBrew House Yield: {:0.2%} (Mash BIAB)".format(bhy)) # BIAB Measurement # This after sparging mash grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(4.5, 1.011 + REF_ADJ, grain_additions) print("\nBrew House Yield: {:0.2%} (Post Sparge)".format(bhy)) # BIAB Measurement # This after second sparging grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(5.0, 1.010 + REF_ADJ, grain_additions) print("\nBrew House Yield: {:0.2%} (Post Second Sparge)".format(bhy)) # Post Extract Addition # Extract adds about 2qt to volume bhy = calculate_brew_house_yield(5.5, 1.052 + REF_ADJ, beer.grain_additions) print("\nBrew House Yield: {:0.2%} (Pre-Boil, after extract addition)".format(bhy)) # noqa # Boil bhy = calculate_brew_house_yield(5.25, 1.065 + REF_ADJ, beer.grain_additions) print("\nBrew House Yield: {:0.2%} (Boil)".format(bhy)) # noqa
def main(): recipe = { u'name': u"10 Pound Stout (Extract)", u'start_volume': 5.0, u'final_volume': 5.0, u'grains': [ { u'name': u'Amber Liquid Extract', u'weight': 6.0 + 15.75 / 16.0, u'grain_type': u'lme' }, { u'name': u'Dark Dry Extract', u'weight': 3.001, u'grain_type': u'dme' }, { u'name': u'Caramel Crystal Malt 120l', u'weight': 1.0, u'grain_type': u'specialty' }, { u'name': u'Black Barley Stout', u'weight': 0.5, u'grain_type': u'specialty' }, { u'name': u'Roasted Barley', u'weight': 0.5, u'grain_type': u'specialty' }, ], u'hops': [ # bittering { u'name': u'Columbus', u'weight': 2.0, u'boil_time': 60.0, u'hop_type': u'pellet', u'percent_alpha_acids': 0.149, # from bag }, # flavoring { u'name': u'Cascade US', u'weight': 7.0, u'boil_time': 15.0, u'hop_type': u'whole wet' }, # from garden # aroma { u'name': u'Cascade US', u'weight': 5.0 + 5.0 / 8.0, u'boil_time': 5.0, u'hop_type': u'whole wet' }, # from garden ], u'yeast': { u'name': u'Wyeast 1084', }, u'data': { u'brew_house_yield': 0.79, u'units': u'imperial', }, } data_dir = os.path.abspath(os.path.join(os.getcwd(), 'data/')) loader = JSONDataLoader(data_dir) beer = parse_recipe(recipe, loader) print(beer.format(short=True)) factory = StyleFactory(os.path.join(data_dir, 'bjcp', 'styles.json')) # style = factory.create_style(15, 'C') # Irish Stout style = factory.create_style(20, 'C') # Imperial Stout print("") print(style.format()) print('Style issues:') errors = style.recipe_errors(beer) for err in errors: print('- {}'.format(err)) # Specialty Grains, Multi Step Mash grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(6.12 / 4.0, 1.030, grain_additions) print("\nBrew House Yield: {:0.2%} (Multi Step Mash)".format(bhy)) # noqa # After diluting grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield( 6.12 / 4.0 + 3.5, # Added into water 1.009, grain_additions) print("\nBrew House Yield: {:0.2%} (Dilution)".format(bhy)) # noqa
def main(): recipe = { u"name": u"Indian Orange Cardamom Milk Stout (Extract)", u"start_volume": 4.0, u"final_volume": 5.0, u"grains": [ {u"name": u"Pale Liquid Extract", u"weight": 7.0, u"grain_type": u"lme"}, {"name": "Milk Sugar Lactose", "weight": 1.0}, { "name": "Black Patent Malt", "weight": 1.0, "grain_type": "specialty", "color": 525, }, { "name": "Caramel Crystal Malt 80l", "weight": 0.75, "grain_type": "specialty", "color": 80, }, { "name": "Chocolate Malt", "weight": 0.5, "grain_type": "specialty", "color": 200, # 180 - 250 }, ], u"hops": [ { "name": "East Kent Golding", "weight": 1.5, "hop_type": "pellet", u"boil_time": 60.0, "percent_alpha_acids": 0.047, } ], u"add_in": [ {"name": "Ground Cardamom", "weight": 0.5, "boil_time": 30.0}, {"name": "Orange Zest", "boil_time": 15.0, "note": "6 oranges"}, ], u"yeast": {u"name": u"Wyeast 1099"}, u"data": {u"brew_house_yield": 0.425, u"units": u"imperial"}, } data_dir = os.path.abspath(os.path.join(os.getcwd(), "data/")) loader = JSONDataLoader(data_dir) beer = parse_recipe(recipe, loader) print(beer.format(short=True)) factory = StyleFactory(os.path.join(data_dir, "bjcp", "styles.json")) style = factory.create_style("16", "A") print("") print(style.format()) print("Style issues:") errors = style.recipe_errors(beer) for err in errors: print("- {}".format(err)) print("") # builder = RecipeBuilder( # name="Sweet Stout", # grain_list=[g.grain for g in beer.grain_additions], # hop_list=[h.hop for h in beer.hop_additions], # target_ibu=27.0, # target_og=1.056, # brew_house_yield=0.425, # start_volume=4.0, # final_volume=5.0, # ) # TODO: Unclear why this doesn't work # percent_list = [0.8044, 0.0869, 0.06525, 0.04345] # grain_additions = builder.get_grain_additions(percent_list) # for grain_add in grain_additions: # print(grain_add.convert_to_cereal().format()) # print("") # BIAB Measurement at 6 qts water added, 1.037 OG # Removal of bag revealed only 4qts, so lost 2 qts to grain. grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(1.0, 1.037, grain_additions) print( "\nBrew House Yield: {:0.2%} (Specialty Grains BIAB, Enzymatic Rest)".format( bhy ) ) # Started with 3 gallons of hot water in pot, added 1 gallon of specialty grains # BIAB Measurement 1.008, volume reduced by 0.5 Gallons # This is before adding extract to volume and after grains were removed grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_SPECIALTY) bhy = calculate_brew_house_yield(4.0, 1.008, grain_additions) print("\nBrew House Yield: {:0.2%} (Specialty Grains BIAB)".format(bhy)) # After extract added # This is after adding extract and lactose to volume and after grains were removed # Before adding lactose we has 1.054 bhy = calculate_brew_house_yield(4.0, 1.063, beer.grain_additions) print("\nBrew House Yield: {:0.2%} (After extract addition)".format(bhy)) lbs_dme = beer.get_wort_correction(63, 4.0) print("\nAdd {:0.2f} lbs of DME to fix wort".format(lbs_dme)) # At this point added 1.0 lbs of DME to bring up the gravity original_gravity = 1.075 # at approximately 4.75 G print("\nOriginal Gravity: {:0.4} at 4.75G".format(original_gravity)) # Added yeast starter (2qt water, 6oz dme) and 2 bags of yeast original_gravity = 1.069 # at approximately 5.33G print("\nOriginal Gravity: {:0.4} at 5.33G".format(original_gravity)) # 1.066 at 5.5G original_gravity = 1.061 # at approximately 6G print("\nOriginal Gravity: {:0.4} at 6G".format(original_gravity)) final_gravity_refractometer = 1.041 print("\nFinal Gravity (r): {:0.4}".format(final_gravity_refractometer)) final_gravity_hydrometer = 1.024 print("\nFinal Gravity (h): {:0.4}".format(final_gravity_hydrometer))
def main(): recipe = { u'name': u"Munich Dunkel (All Grain)", u'start_volume': 7.0, u'final_volume': 6.0, u'grains': [ { u'name': u'Munich Malt', u'weight': 12.2, u'grain_type': u'cereal' }, { u'name': u'Chocolate Malt', u'weight': 0.38, u'data': { u'color': 420.0 }, u'grain_type': u'cereal' }, { u'name': u'Light Dry Extract', u'weight': 0.375, u'grain_type': u'dme', u'notes': u'Added from yeast starter' }, { u'name': u'Light Dry Extract', u'weight': 2.7125, u'grain_type': u'dme', u'notes': u'Added to correct gravity' }, ], u'hops': [ # bittering { u'name': u'Hallertau US', u'weight': 1.25, u'boil_time': 60.0, u'hop_type': u'pellet', u'percent_alpha_acids': 0.038, # from bag }, # flavoring { u'name': u'Hallertau US', u'weight': 0.75, u'boil_time': 20.0, u'hop_type': u'pellet', u'percent_alpha_acids': 0.038, # from bag }, ], u'yeast': { u'name': u'Wyeast 2308', }, u'data': { u'brew_house_yield': 0.5684, u'units': u'imperial', }, } data_dir = os.path.abspath(os.path.join(os.getcwd(), 'data/')) loader = JSONDataLoader(data_dir) beer = parse_recipe(recipe, loader) print(beer.format(short=True)) factory = StyleFactory(os.path.join(data_dir, 'bjcp', 'styles.json')) style = factory.create_style(8, 'A') # Munich Dunkel print("") print(style.format()) print('Style issues:') errors = style.recipe_errors(beer) for err in errors: print('- {}'.format(err)) # Multi Step Mash grain_additions = beer.get_grain_additions_by_type(GRAIN_TYPE_CEREAL) bhy = calculate_brew_house_yield( 5.36, 1.049, # measure after lautering grain_additions) print("\nBrew House Yield: {:0.2%} (Multi Step Mash)".format(bhy)) # noqa
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.brew_house_yield)