-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add formula for calculating SRM #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the contribution. Calculating the color is a great idea. Please check my code suggestion before merging.
Happy Holidays!
I just double-checked the brew wiki reference page. Apparently, in the provided formula the malt weight needs to be in pounds ( According to the BeerXML specification all volume and weight units are metric. (liters and kilogram) http://www.beerxml.com/beerxml.htm Therefore, the color implementation is wrong as is. I suppose it can easily be fixed by converting the units accordingly. |
The formula is correct. |
* `mcu` default value is now a float * Check for fermentable amount and color for `None` * Correct metric to imperial conversion factor * Add test to ensure color updates for recipe are ignored
I've updated this PR with a new commit. Please review. Thanks! |
mcu = 0.0 | ||
for f in self.fermentables: | ||
if f.amount is not None and f.color is not None: | ||
# 8.3454 is conversion factor from kg/L to lb/gal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@shouptech I released version |
I have added a formula to the Recipe class which will calculate a recipe's color in units SRM.