def main(): recipe = { u"name": u"Kölsch Ale (Extract)", u"start_volume": 2.5, u"final_volume": 5.0, u"grains": [ { u"name": u"Pilsner Liquid Extract", u"weight": 3.25, u"grain_type": u"lme", }, { u"name": u"Munich Liquid Extract", u"data": { u"color": 10.0, u"ppg": 36 }, u"weight": 3.25, u"grain_type": u"lme", }, { u"name": u"White Wheat Malt", u"weight": 0.25, u"grain_type": u"specialty", }, { u"name": u"Caramel Crystal Malt 10l", u"weight": 0.25, u"grain_type": u"specialty", }, ], u"hops": [ { u"name": u"Vanguard", u"weight": 1.0, u"boil_time": 60.0 }, { u"name": u"hersbrucker", u"weight": 1.0, u"boil_time": 0.0 }, ], u"yeast": { u"name": u"White Labs Wlp029" }, u"data": { u"brew_house_yield": 0.70, 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())
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, u"grain_type": u"lme" }, { u"name": u"Caramel Crystal Malt 80l", u"weight": 1.0, u"grain_type": u"specialty", }, { u"name": u"Smoked Malt", # Rausch means "Smoked" u"weight": 1.0, u"data": { u"color": 6.0 }, u"grain_type": u"specialty", }, { u"name": u"Victory Malt", u"weight": 1.0, 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())
def main(): recipe = { u'name': u"Kölsch Ale (Extract)", u'start_volume': 2.5, u'final_volume': 5.0, u'grains': [ { u'name': u'Pilsner Liquid Extract', u'weight': 3.25, u'grain_type': u'lme' }, { u'name': u'Munich Liquid Extract', u'data': { u'color': 10.0, u'ppg': 36, }, u'weight': 3.25, u'grain_type': u'lme' }, { u'name': u'White Wheat Malt', u'weight': 0.25, u'grain_type': u'specialty' }, { u'name': u'Caramel Crystal Malt 10l', u'weight': 0.25, u'grain_type': u'specialty' }, ], u'hops': [ { u'name': u'Vanguard', u'weight': 1.0, u'boil_time': 60.0 }, { u'name': u'hersbrucker', u'weight': 1.0, u'boil_time': 0.0 }, ], u'yeast': { u'name': u'White Labs Wlp029', }, u'data': { u'brew_house_yield': 0.70, 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())
def main(): recipe = { u'name': u"Wunderbah Heffeweizen (Extract)", u'start_volume': 4.0, u'final_volume': 5.0, u'grains': [ { u'name': u'Wheat Liquid Extract', u'weight': 7.0 + (7.25 - 3.5) / 16, u'grain_type': u'lme' }, ], u'hops': [ # bittering { u'name': u'Hallertau US', u'weight': 1.0, u'boil_time': 60.0, u'hop_type': u'whole', u'percent_alpha_acids': 0.054, # from bag }, # flavoring { u'name': u'Hallertau US', u'weight': 1.0, u'boil_time': 30.0, u'hop_type': u'whole', u'percent_alpha_acids': 0.054, # from bag }, ], u'yeast': { u'name': u'Wyeast 3068', }, u'data': { 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(10, 'A') # German Wheat Beer, Weizen/Weissbier print("") print(style.format()) print('Style issues:') errors = style.recipe_errors(beer) for err in errors: print('- {}'.format(err))
def main(): recipe = { u"name": u"Raison de Saison (Extract)", u"start_volume": 7.0, u"final_volume": 6.0, u"grains": [ { u"name": u"Pilsner Liquid Extract", u"data": {u"color": 2.3, u"ppg": 37}, u"weight": 7.7, u"grain_type": u"lme", }, {u"name": u"Cane Beet Sugar", u"weight": 1.0, u"grain_type": u"dme"}, { u"name": u"Wheat Liquid Extract", u"data": {u"color": 4.0, u"ppg": 37}, u"weight": 0.75, u"grain_type": u"lme", }, { u"name": u"munich liquid malt extract", u"data": {u"color": 9.0, u"ppg": 37}, u"weight": 0.5, u"grain_type": u"lme", }, { u"name": u"Caramunich Malt", u"data": {u"color": 60.0}, u"weight": 0.125, u"grain_type": u"specialty", }, ], u"hops": [ { u"name": u"Hallertau US", u"data": {u"percent_alpha_acids": 0.05}, u"weight": 1.7, u"boil_time": 60.0, }, { u"name": u"Hallertau US", u"data": {u"percent_alpha_acids": 0.05}, u"weight": 0.75, u"boil_time": 0.0, }, ], u"yeast": {u"name": u"Wyeast 3724", u"data": {u"percent_attenuation": 0.86}}, u"data": {u"brew_house_yield": 0.70, 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())
class TestJSONDataLoader(unittest.TestCase): def setUp(self): self.loader = JSONDataLoader('./') def test_format_name(self): name_list = [(u'pale malt 2-row us', u'pale_malt_2_row_us'), (u'caramel crystal malt 20l', u'caramel_crystal_malt_20l'), # noqa (u'centennial', u'centennial'), (u'cascade us', u'cascade_us'), (u'Wyeast 1056', u'wyeast_1056'), ] for name, expected in name_list: out = self.loader.format_name(name) self.assertEquals(out, expected)
class TestJSONDataLoader(unittest.TestCase): def setUp(self): self.loader = JSONDataLoader("./") def test_format_name(self): name_list = [ (u"pale malt 2-row us", u"pale_malt_2_row_us"), (u"caramel crystal malt 20l", u"caramel_crystal_malt_20l"), # noqa (u"centennial", u"centennial"), (u"cascade us", u"cascade_us"), (u"Wyeast 1056", u"wyeast_1056"), ] for name, expected in name_list: out = self.loader.format_name(name) self.assertEquals(out, expected)
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 main(): recipe = { u'name': u"White House Honey Ale (Extract)", u'start_volume': 3.0, u'final_volume': 5.0, u'grains': [ { u'name': u'Caramel Crystal Malt 60l', u'weight': 0.75, u'grain_type': u'specialty' }, { u'name': u'Biscuit Malt', u'weight': 0.5, u'grain_type': u'specialty' }, { u'name': u'Pilsner Liquid Extract', u'weight': 3.3, u'data': { u'color': 8.0 }, u'grain_type': u'lme' }, { u'name': u'Light Dry Extract', u'weight': 1.0, u'grain_type': u'dme' }, # Add honey after aroma hops, boil for 5 min { u'name': u'Honey', u'weight': 1.0, u'grain_type': u'lme' }, ], u'hops': [ # bittering { u'name': u'East Kent Golding', u'weight': 1.5, u'boil_time': 45.0, u'hop_type': u'pellet', u'percent_alpha_acids': 0.058, # from bag }, # flavoring (none) # aroma { u'name': u'Fuggle', u'weight': 1.5, u'boil_time': 1.0, u'hop_type': u'pellet', u'percent_alpha_acids': 0.049, # from bag }, ], u'yeast': { u'name': u'Danstar Lallemand Windsor Ale Yeast', }, u'data': { 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( 26, 'B') # Belgian Dubbel (Wikipedia), could be 23 Specialty print("") print(style.format()) print('Style issues:') errors = style.recipe_errors(beer) for err in errors: print('- {}'.format(err))
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())
def main(): recipe = { u"name": u"Munich Madness (All Grain)", u"start_volume": 7.0, u"final_volume": 6.0, u"grains": [ { u"name": u"Pilsner 2 row Ger", u"data": { u"color": 2.3 }, u"weight": 5.0 }, { u"name": u"Munich Malt 10L", u"data": { u"color": 9.0 }, u"weight": 4.0 }, { u"name": u"Vienna Malt", u"weight": 3.0 }, { u"name": u"Caramunich Malt", u"data": { u"color": 60.0 }, u"weight": 1.0, u"grain_type": u"specialty", }, ], u"hops": [ { u"name": u"Hallertau US", u"data": { u"percent_alpha_acids": 0.04 }, u"weight": 1.5, u"boil_time": 60.0, }, { u"name": u"Hallertau US", u"data": { u"percent_alpha_acids": 0.04 }, u"weight": 0.5, u"boil_time": 20.0, }, ], u"yeast": { u"name": u"Wyeast 2206", u"data": { u"percent_attenuation": 0.73 } }, u"data": { u"brew_house_yield": 0.70, 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())
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"Lunar Eclipse Red (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"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.7, 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())
def main(): recipe = { u"name": u"10 Pound Stout (Extract)", u"start_volume": 4.0, u"final_volume": 5.0, u"grains": [ { u"name": u"Amber Liquid Extract", u"weight": 7.0, u"grain_type": u"lme" }, { u"name": u"Dark Dry Extract", u"weight": 3.0, 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": [ { u"name": u"Columbus", u"weight": 1.0, u"boil_time": 60.0 }, { u"name": u"Columbus", u"weight": 1.0, u"boil_time": 5.0 }, ], u"yeast": { u"name": u"Wyeast 1084" }, u"data": { u"brew_house_yield": 0.80, 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())
def setUp(self): self.loader = JSONDataLoader('./')
def main(): recipe = { u"name": u"Biere de l'Inde (Extract)", u"start_volume": 7.0, u"final_volume": 6.0, u"grains": [ { u"name": u"English Pale Ale Liquid Extract", u"data": { u"color": 3.5, u"ppg": 37 }, u"weight": 8.7, u"grain_type": u"lme", }, { u"name": u"wheat liquid extract", u"data": { u"color": 4.0, u"ppg": 37 }, u"weight": 0.5, u"grain_type": u"lme", }, { u"name": u"biscuit malt", u"data": { u"color": 25.0 }, u"weight": 0.5, u"grain_type": u"specialty", }, { u"name": u"caramel crystal malt 40l", u"weight": 0.5, u"grain_type": u"specialty", }, { u"name": u"caramel crystal malt 120l", u"weight": 0.375, u"grain_type": u"specialty", }, ], u"hops": [ { u"name": u"challenger", u"data": { u"percent_alpha_acids": 0.08 }, u"weight": 1.43, u"boil_time": 60.0, }, { u"name": u"fuggle", u"data": { u"percent_alpha_acids": 0.05 }, u"weight": 1.5, u"boil_time": 10.0, }, { u"name": u"east kent golding", u"data": { u"percent_alpha_acids": 0.05 }, u"weight": 1.5, u"boil_time": 0.0, }, ], u"yeast": { u"name": u"Wyeast 1028", u"data": { u"percent_attenuation": 0.74 } }, u"data": { u"brew_house_yield": 0.70, 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())
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 main(): """ From Northern Brewer Kit """ brew_house_yield = 0.425 recipe = { u"name": u"Kama Citra Session IPA (Extract)", u"start_volume": 2.5, u"final_volume": 5.0, u"grains": [ { "name": "Golden Light Liquid Extract", "weight": 6.0, "grain_type": "lme" }, { "name": "Golden Light Dry Extract", "weight": 1.0, "grain_type": "dme" }, { "name": "Caramel Crystal Malt 40l", # Valencia Grains Caramel 40 "weight": 0.75, "grain_type": "specialty", } ], u"hops": [ { "name": "Centennial", "weight": 0.5, "hop_type": "pellet", "boil_time": 60.0, "percent_alpha_acids": 0.082, }, { "name": "Cascade US", "weight": 1.0, "hop_type": "pellet", "boil_time": 20.0, "percent_alpha_acids": 0.06, }, { "name": "Cascade US", "weight": 1.0, "hop_type": "pellet", "boil_time": 10.0, "percent_alpha_acids": 0.06, }, { "name": "Citra", "weight": 2.0, "hop_type": "pellet", "boil_time": 0.0, "percent_alpha_acids": 0.133, } # { # Dry Hop # "name": "Cascade", # "weight": 1.0, # "hop_type": "pellet", # u"boil_time": 10.0, # "percent_alpha_acids": 0.06, # }, # { # Dry Hop # "name": "Citra", # "weight": 2.0, # "hop_type": "pellet", # u"boil_time": 0.0, # "percent_alpha_acids": 0.133, # }, ], u"yeast": { "name": "Omega Yeast 009", }, u"data": {u"brew_house_yield": brew_house_yield, 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", "B") print("") print(style.format()) print("Style issues:") errors = style.recipe_errors(beer) for err in errors: print("- {}".format(err)) print("") builder = RecipeBuilder( name="Specialty IPA", 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.50, brew_house_yield=brew_house_yield, start_volume=2.5, final_volume=5.0, )
def setUp(self): self.loader = JSONDataLoader("./")
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"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"Pale Ale", u"start_volume": 7.0, u"final_volume": 5.0, u"grains": [ { u"name": u"pale malt 2-row us", u"data": { u"color": 1.8, u"ppg": 37 }, u"weight": 13.96, }, { u"name": u"caramel crystal malt 20l", u"data": { u"color": 20.0, u"ppg": 35 }, u"weight": 0.78, }, ], u"hops": [ { u"name": u"centennial", u"data": { u"percent_alpha_acids": 0.14 }, u"weight": 0.57, u"boil_time": 60.0, }, { u"name": u"cascade us", u"data": { u"percent_alpha_acids": 0.07 }, u"weight": 0.76, u"boil_time": 5.0, }, ], u"yeast": { u"name": u"Wyeast 1056", u"data": { u"percent_attenuation": 0.75 } }, u"data": { u"brew_house_yield": 0.70, 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())
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