1
0
Fork 0
mirror of https://github.com/shouptech/synthale.git synced 2026-02-03 15:39:45 +00:00

Compare commits

...

3 commits

Author SHA1 Message Date
cbd2619f90 Bump version: 0.1.0 → 0.1.1 2019-01-04 08:46:06 -07:00
0214065276 Add CHANGELOG 2019-01-04 08:45:52 -07:00
dae353ce72 Fix #1
Updates so that dry hop time is displayed in time.
2019-01-04 08:42:21 -07:00
8 changed files with 50 additions and 9 deletions

15
CHANGELOG.rst Normal file
View file

@ -0,0 +1,15 @@
Changelog
=========
0.1.1 - 2018-01-04
------------------
* Fix `Issue 1`_, dry hop times are now in days.
* Added a Changelog
.. _`Issue 1`: https://github.com/shouptech/synthale/issues/1
0.1.0 - 2018-01-03
------------------
* Initial release

View file

@ -55,9 +55,9 @@ author = 'Mike Shoup'
# built documents.
#
# The short X.Y version.
version = '0.1.0'
version = '0.1.1'
# The full version, including alpha/beta/rc tags.
release = '0.1.0'
release = '0.1.1'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View file

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.0
current_version = 0.1.1
commit = True
tag = True
tag_name = {new_version}

View file

@ -28,7 +28,7 @@ install_requires = [
setup(
name='synthale',
version='0.1.0',
version='0.1.1',
url='https://github.com/shouptech/synthale',
author='Mike Shoup',
author_email='mike@shoup.io',

View file

@ -15,4 +15,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
VERSION = '0.1.0'
VERSION = '0.1.1'

View file

@ -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 (

View file

@ -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>

View file

@ -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 |'
)