drodil / rustybeer Goto Github PK
View Code? Open in Web Editor NEWCLI tool to calculate beer brewing values for different things
Home Page: https://drodil.github.io/rustybeer/
License: Other
CLI tool to calculate beer brewing values for different things
Home Page: https://drodil.github.io/rustybeer/
License: Other
While we are at it, how about writing some unit tests for the modules?
Create a calculator to convert between LME (Liquid Malt Extract) and DME (Dried Malt Extract). The calculator should output the amount each other is needed to preserve the same gravity. See example here https://www.brewersfriend.com/lme-dme-conversion-calculator/
Also create a CLI and web interface for this (or if you are feeling lazy, create new issues for those).
Add https://github.com/rust-lang/rust-clippy to be used in the push workflow to detect possible lint errors in the code. If possible this check should also prevent merging the push request if any lint errors are found in the code. Additionally fix current bugs or disable them in the repository.
Add new calculator to calculate what is the correct setting for the keg regulator to achieve given amount of CO2.
Input parameters should be
And output should be the regulator pressure in psi.
Map the outcomes of #23 and #39 to be able to identify good hops for specific beer style. See http://www.hopslist.com/style-guide/ as an example.
This may be a stupid question, but why use the futures library? This doesn't seem like the kind of task that requires async programming, unless there's some requirement in the CLI app which I'm not aware of.
Would someone mind explaining to me why it's included?
To be able to calculate for example IBU or SRM we need the incredients from the recipe. Add support for parsing BeerXML to an internal representation of the recipe that can be used by the commands.
See specification here: http://www.beerxml.com/
Current version of Github Pages is just rendering the README.md. To bring more life to the project, configure the Github pages properly to be able to use themes and also add extra content to it. See https://docs.github.com/en/pages for instructions
The trait defined in app_subcommand.rs (AppSubCommand) is never implemented, and redefined in main.rs
The only thing in app_subcommand.rs is the trait itself-if the trait is ever used in any way, it could be put in lib.rs, and app_subcommand.rs itself removed
As yeasts go bad after a period of time, the viability should be calculated to pitch in the correct amount of yeast. See https://www.morebeer.com/content/yeast_viability_calculator as an example of calculating the yeast viability. Input should be initial cell count and production date and the output should contain viability in percent as well as how many cells are still viable.
Probably you will need a utility to parse date from the command line parameter of different date formats (dd.mm.YYYY or mm/dd/YYYY etc.)
Add also command to run this calculator from CLI
To be able to use this in drodil/rustybeer-aws-lambda project, a library of the rustybeer should be shipped as well. This should be easily done by changing the Cargo.toml file to describe the lib and bin like follows:
[lib]
name = "librustybeer"
[[bin]]
name = "rustybeer"
Maybe we need to create lib.rs for the library which exposes all the calculator functionality. See https://doc.rust-lang.org/cargo/guide/project-layout.html for more information.
We need a boil-off calculator to calculate how much you need to boil down your wort volume to hit a certain gravity. Parameters are volume of the wort, current gravity and desired gravity. The output shall be the the new wort volume as well as the difference. Calculation is:
new volume = ((current gravity-1) / (desired gravity-1)) * current volume
Add calculator to calculate calories in beer serving of different sizes or by custom volume (100ml by default). Use calculation formula example from here http://www.brewunited.com/beer_calorie_calculator.php
The calculator should take parameters for ABV or original+final gravity (use AbvCalculator to calculate ABV from those). It should report calories for all custom values given for volumes and additionally for different serving sizes done as part of #35
Calories should be reported in kcal and kJ per serving size. Additionally carbs amount would be interesting.
Add also command to run this calculator from CLI
To be able to do more calculations add information about most known fermentables to the application. There should be at least the following information available:
Add the most used fermentables as constants (see #23 as an example) and command to find fermentables based on criteria. Also see #43 if it can bring any help to this.
For potential and yield you can find some information here https://www.homebrewtalk.com/wiki/index.php/Malts_Chart
Currently only specific gravity (1.xxx) is allowed to be used as input for gravity calculations. Create a new struct for this that can handle the conversions and to and from different units (specific gravity, brix, plato). See example structs from the measurements crate here https://github.com/rust-embedded-community/rust-measurements/tree/master/src
See also these as reference:
Once you have struct in place, replace functions wanting gravity as value to use the new struct (also from CLI and server).
For extra points, include the new functionality also to that project for some good open source spirit!
There should be possibility to input gravity with Plato or SG. This is why we need a way to convert between these two. Add new functionality to #25 (utils/conversions.rs) to figure out if the input is Plato or SG and allow converting between these two. See http://betatestbrewing.com/pages/plato_to_sg.html for formulas for this.
Additionally fix existing calculators to use the new conversion tool for input parameters (abv, sg_correction at least but check out commands that want to use gravity)
Tip: If the input ends with "P" it is definetly plato unit. Also if the decimal number is way over 1.5 it's most likely plato ;)
Add missing documentation especially for the calculators. What are the expected inputs and in which unit is crucial information for the user of the library.
Create a calculator to estimate final gravity based on original gravity and yeast attenuation. See https://www.northernbrewer.com/blogs/beer-recipes-ingredients/final-gravity for further details. Input parameters should be the original gravity and the attenuation of the yeast used. This change could use implementation of #41 to get the attenuation rates for specific yeasts so that user could just pass in the yeast they are using by name.
Additionally create CLI command to run the calculator.
Some hops can be substituted with other types of hops in case the brewer is missing the ingredient. Add a way to find substitution hop based on name of the hop. See https://www.homebrewersassociation.org/how-to-brew/hop-substitutions/ for the data. Add command to use the functionality.
Requires implementation of #39
Hide the loading of data behind a function for example
fn get_beer_styles(criteria: Option<Criteria>) -> Vec<BeerStyle>
Move the filtering by criteria to these functions from the rustybeer-server and rustybeer-cli which both do the same thing for the list based on the criteria.
To be able to do more calculations add information about most known yeasts to the application. There should be at least the following information available:
See https://www.brewersfriend.com/yeast/ for most known yeasts and add constants for those.
Additionally add command to find yeasts based on the yeast properties.
See #23 as an example.
We need a dilution calculator to calculate how much you need to dilute your wort volume to hit a certain gravity. Parameters are volume of the wort, current gravity and target volume. The output shall be the the new gravity as well as the difference. Calculation is:
new gravity = (current gravity-1) * (current volume / target volume)
To be able to run this tool more than just from the subcommands, it would be beneficial to create a TUI for rustybeer. Maybe it could be done by utilizing the https://github.com/gyscos/cursive
The interactive tool would be very helpful in the brewery as you wouldn't need to remember all the subcommands and parameters.
Refactor calorie counter to take the volume as input (relates also to #109 ). Remove the abv_calories.rs from the util library as the calorie count can be calculated for abv easily by multiplying the beers ABV % by a factor of ~2.5 and then multiplying that number by how many fluid ounces the bottle holds. To make this easier, the volume should come as measurements::Volume struct.
To be able to calculate SRM we need the fermentable information with color as well as batch size and amount of fermentable. See #44 for support of basic fermentables so the user does not need to input the color information for every fermentable. The formula for this can be found in http://beersmith.com/blog/2008/04/29/beer-color-understanding-srm-lovibond-and-ebc/
Additionally the calculator should give out SRM (Standard Reference Method), Degrees Lovibond and EBC (European Beer Color) and hex value for the color. See https://www.brewersfriend.com/color-calculator/ as an example of the conversion. The conversion should be placed in another calculator so that it can be used as its own command.
When release is made from rustybeer, publish the rustybeer library to crates.io automatically. See the following documentation:
Create calculator to calculate hydrometer temperature adjustement based on gravity, hydrometer correction and temperature of the wort. See example calculator here https://www.brewersfriend.com/hydrometer-temp/
Add possibility to calculate estimated IBU based on added hops. Global parameters needed are:
The user should be able to add multiple hops from the CLI interface (or by using the library). Each hop should have the following characterics:
The calculator should return estimated boil gravity and IBU.
To be able to use IBU calculator without need to set AA for all hops it would be beneficial to have most known hops in the app. Create new struct for hop and define constant hops from https://www.brewersfriend.com/hops/ . Each hop should have name, average AA and aroma/bittering(boil)/whirlpool/dry hop (enum) usage information.
Additionally create command to find hops based on their average AA with min and max values or with their usage type.
See #23 as an example.
The tests contained in rustybeer/tests/calculator.rs
seem to be wrong, especially those in the boil_off
test-the second and third tests have the same right hand side, but different left hand sides-is this intended, or is there an error included somewhere? (#81 will change this anyway, but that may have the wrong effect)
Add more information about the tool to help. For example acronyms that are used (ABV, FG, OG, SG, IBU... etc. See https://brewhq.ca/blogs/academy/know-your-brewing-acronyms) could be useful for the user. Use clap https://docs.rs/clap/2.9.3/clap/struct.App.html#method.after_help and https://docs.rs/clap/2.9.3/clap/struct.App.html#method.before_help to achieve this. Also other improvements for the command line parameter handling are welcome!
Create a calculator that will calculate original gravity based on fermentables used, the batch size and brewhouse efficiency. See http://www.gtrbrewers.org/newsletter-articles/calculatingoriginalgravity for further details. This also could get help from implementing the #44 before this.
Additionally add CLI command to calculate the gravity with inputs.
Few people will have rustc on their system, and that may put them off using the CLI-the project could be built with the --release
tag and put in the releases
tab of the main page to make it more accessible for people to download and use in their brewing projects
Add new calculator to calculate Alcohol By Weight <-> Alcohol By Volume. The conversion should be done as follows:
ABV (percentage) = ABW (grams) * 1.25
ABW (grams) = ABV (percentage) * 0.80
Additionally the calculator could optionally get volume of the beer (see #25 ) and show how many grams of alcohol it contains (ABW is grams of alcohol in 100 centilitres of beer).
Optionally original and final gravities could be used instead ABV (and use AbvCalculator with these)
To be able to verify follow of coding standards, add rustfmt check to the github action in .github/workflows/rust.yml
Additionally the code needs to be reformatted to get the PR through the check.
To be able to provide information what fermentable works with different beer style it would be possible to map implementation of #23 and #44 for this. See https://www.craftbeer.com/beer/beer-styles-guide as an example of good mappings (Common Malt Ingredients for each style)
There is some warnings generated with cargo clippy --all-targets. Minor fixes but would be beneficial to be fixed before more code evolves.
This should be an easy one. Single parameter of the volume to bottle and then show up how many bottles is needed to bottle the whole beer. The following bottles should be calculated:
The number of bottles should be rounded up.
We need global parameters to select whether to use imperial or metric units for:
For all of these we should provide different parameter in the main program parameters. Additionally a conversion tool that can be used should be in place for the sub-commands to use.
Refactor rustybeer calculators to use measurements structs. This will standardize the API to accept input in any unit and also to return structs that can be converted to the users desired unit. At least the following calculators could take this into use:
At the moment the functions in these calculators take mixed units (from fahrenheit to grams to fluid ounces etc.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.