diff --git a/CHANGELOG.md b/CHANGELOG.md index 2149575..59073b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- 3 new water units + 1. Tablespoon (`tbsp`) + 2. Teaspoon (`tsp`) + 3. Dessertspoon (`dsp`) ## [0.8] - 2024-11-29 ### Added - 1 new coffee unit diff --git a/mycoffee/params.py b/mycoffee/params.py index a822ff7..108926d 100644 --- a/mycoffee/params.py +++ b/mycoffee/params.py @@ -211,5 +211,8 @@ "oz": {"name": "ounce", "rate": 0.03527396195}, "lb": {"name": "pound", "rate": 0.00220462262185}, "mg": {"name": "milligram", "rate": 1000}, - "kg": {"name": "kilogram", "rate": 0.001} + "kg": {"name": "kilogram", "rate": 0.001}, + "tbsp": {"name": "tablespoon", "rate": 0.067628}, + "tsp": {"name": "teaspoon", "rate": 0.20288}, + "dsp": {"name": "dessertspoon", "rate": 0.10144}, } diff --git a/test/functions_test.py b/test/functions_test.py index 697bc0b..78abed0 100644 --- a/test/functions_test.py +++ b/test/functions_test.py @@ -154,13 +154,16 @@ >>> show_water_units_list() Water units list: -1. `g` - gram -2. `kg` - kilogram -3. `l` - liter -4. `lb` - pound -5. `mg` - milligram -6. `ml` - milliliter -7. `oz` - ounce +1. `dsp` - dessertspoon +2. `g` - gram +3. `kg` - kilogram +4. `l` - liter +5. `lb` - pound +6. `mg` - milligram +7. `ml` - milliliter +8. `oz` - ounce +9. `tbsp` - tablespoon +10. `tsp` - teaspoon >>> test_params = {"method":"v60", "cups":1, "water":335, "coffee_ratio": 3, "water_ratio":50, "info":"V60 method", 'coffee_unit': 'g'} >>> calc_coffee(test_params) 20.1 @@ -398,11 +401,14 @@ >>> run(args) Water units list: -1. `g` - gram -2. `kg` - kilogram -3. `l` - liter -4. `lb` - pound -5. `mg` - milligram -6. `ml` - milliliter -7. `oz` - ounce +1. `dsp` - dessertspoon +2. `g` - gram +3. `kg` - kilogram +4. `l` - liter +5. `lb` - pound +6. `mg` - milligram +7. `ml` - milliliter +8. `oz` - ounce +9. `tbsp` - tablespoon +10. `tsp` - teaspoon """ diff --git a/test/verified_test.py b/test/verified_test.py index 4a77fe4..7c4ee28 100644 --- a/test/verified_test.py +++ b/test/verified_test.py @@ -331,4 +331,16 @@ True >>> convert_water(240, "l", True) == 240000.0 # https://www.howmany.wiki/wv/ True +>>> convert_water(240, "tbsp") == 16.230719999999998 # https://www.howmany.wiki/wv/ +True +>>> convert_water(240, "tbsp", True) == 3548.8259300881296 # https://www.howmany.wiki/wv/ +True +>>> convert_water(240, "tsp") == 48.6912 # https://www.howmany.wiki/wv/ +True +>>> convert_water(240, "tsp", True) == 1182.9652996845425 # https://www.howmany.wiki/wv/ +True +>>> convert_water(240, "dsp") == 24.3456 # https://www.howmany.wiki/wv/ +True +>>> convert_water(240, "dsp", True) == 2365.930599369085 # https://www.howmany.wiki/wv/ +True """