Skip to content

Commit

Permalink
Pint Unit for Water (#54)
Browse files Browse the repository at this point in the history
* add : `Pint` scale for water added.

* test : tests added.

* log : changes logged.

* fix : tests fixed.

* update : authors updated.
  • Loading branch information
sadrasabouri authored Dec 9, 2024
1 parent 8fdbfb6 commit 817674a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
----------
- [@boreshnavard](https://github.com/boreshnavard) **
- [@AHReccese](https://github.com/AHReccese)
- [@sadrasabouri](https://github.com/sadrasabouri)


** Graphic designer
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ 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
- 1 new water unit
1. Pint (`pt`)
## [0.9] - 2024-12-06
### Added
- 4 new water units
Expand Down
1 change: 1 addition & 0 deletions mycoffee/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,5 @@
"tsp": {"name": "teaspoon", "rate": 0.20288},
"dsp": {"name": "dessertspoon", "rate": 0.10144},
"cup": {"name": "cup", "rate": 0.0042268},
"pt": {"name": "pint", "rate": 0.00211338},
}
14 changes: 8 additions & 6 deletions test/functions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,14 @@
2. `dsp` - dessertspoon
3. `g` - gram
4. `kg` - kilogram
5. `l` - liter
5. `l` - liter
6. `lb` - pound
7. `mg` - milligram
8. `ml` - milliliter
9. `oz` - ounce
10. `tbsp` - tablespoon
11. `tsp` - teaspoon
10. `pt` - pint
11. `tbsp` - tablespoon
12. `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
Expand Down Expand Up @@ -406,11 +407,12 @@
2. `dsp` - dessertspoon
3. `g` - gram
4. `kg` - kilogram
5. `l` - liter
5. `l` - liter
6. `lb` - pound
7. `mg` - milligram
8. `ml` - milliliter
9. `oz` - ounce
10. `tbsp` - tablespoon
11. `tsp` - teaspoon
10. `pt` - pint
11. `tbsp` - tablespoon
12. `tsp` - teaspoon
"""
4 changes: 4 additions & 0 deletions test/verified_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,8 @@
True
>>> convert_water(240, "cup", True) == 56780.54320052995 # https://www.howmany.wiki/wv/
True
>>> round(convert_water(240, "pt"), 5) == 0.50721 # https://www.inchcalculator.com/convert/milliliter-to-pint/
True
>>> int(convert_water(240, "pt", True)) == 113562 # https://www.inchcalculator.com/convert/milliliter-to-pint/
True
"""

0 comments on commit 817674a

Please sign in to comment.