mirror of
https://github.com/shouptech/synthale.git
synced 2026-02-03 07:29:42 +00:00
parent
9e1ad56ae7
commit
dae353ce72
3 changed files with 30 additions and 4 deletions
|
|
@ -185,6 +185,7 @@ class MarkdownRecipe:
|
|||
headers = ('Name', 'Origin', 'Alpha', 'Amount', 'Time', 'Use')
|
||||
rows = []
|
||||
for hop in self.recipe.hops:
|
||||
# Determine hop unit
|
||||
if self.hop_unit == 'pounds':
|
||||
amt = convert.pounds(hop.amount, '.2f')
|
||||
elif self.hop_unit == 'grams':
|
||||
|
|
@ -193,12 +194,19 @@ class MarkdownRecipe:
|
|||
amt = convert.kilograms(hop.amount, '.2f')
|
||||
else:
|
||||
amt = convert.ounces(hop.amount, '.1f')
|
||||
|
||||
# Determine hop timing
|
||||
if hop.use == 'Dry Hop':
|
||||
# 1 day = 1440 minutes
|
||||
time = '{:.1f} days'.format(hop.time / 1440.0)
|
||||
else:
|
||||
time = '{} min'.format(int(round(hop.time)))
|
||||
rows.append((
|
||||
hop.name,
|
||||
hop.origin,
|
||||
'{:.1f} %'.format(hop.alpha),
|
||||
amt,
|
||||
'{}'.format(int(round(hop.time))),
|
||||
time,
|
||||
hop.use,
|
||||
))
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -76,6 +76,19 @@
|
|||
<DISPLAY_TIME>60.0 min</DISPLAY_TIME>
|
||||
<NOTES></NOTES>
|
||||
</HOP>
|
||||
<HOP>
|
||||
<NAME>Cascade</NAME>
|
||||
<ORIGIN>U.S.</ORIGIN>
|
||||
<ALPHA>5.5</ALPHA>
|
||||
<BETA></BETA>
|
||||
<AMOUNT>0.0141747</AMOUNT>
|
||||
<DISPLAY_AMOUNT>0.5 oz</DISPLAY_AMOUNT>
|
||||
<USE>Dry Hop</USE>
|
||||
<FORM>Pellet</FORM>
|
||||
<TIME>7200</TIME>
|
||||
<DISPLAY_TIME>5 days</DISPLAY_TIME>
|
||||
<NOTES></NOTES>
|
||||
</HOP>
|
||||
</HOPS>
|
||||
<YEASTS>
|
||||
<YEAST>
|
||||
|
|
|
|||
|
|
@ -128,9 +128,14 @@ def test_recipe_hops(md_weizen):
|
|||
assert md_weizen.hops == (
|
||||
'Hops\n'
|
||||
'----\n'
|
||||
'| Name | Origin | Alpha | Amount | Time | Use |\n'
|
||||
'| -------------------- | ------- | ----- | ------ | ---- | ---- |\n'
|
||||
'| Northern Brewer (DE) | Germany | 4.9 % | 1.0 oz | 60 | Boil |'
|
||||
'| Name | Origin | Alpha | Amount | Time |'
|
||||
' Use |\n'
|
||||
'| -------------------- | ------- | ----- | ------ | -------- |'
|
||||
' ------- |\n'
|
||||
'| Northern Brewer (DE) | Germany | 4.9 % | 1.0 oz | 60 min |'
|
||||
' Boil |\n'
|
||||
'| Cascade | U.S. | 5.5 % | 0.5 oz | 5.0 days |'
|
||||
' Dry Hop |'
|
||||
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue