Skip to content
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

[WB-29]: Add conversion/display functions for all units of measure #95

Merged
merged 11 commits into from
Jun 11, 2023

Conversation

nnichols
Copy link
Member

Proposed Changes

  • Additions: A namespace for all unit types described by BeerXML. Conversion/display-time functions for all supported unit types
  • Updates: BREAKING: Refactor the units namespace to solely contain the convert and display functions.
  • Deletions: BREAKING convert-weight, convert-volume, convert-temperature, and brewtility.color

Pre-merge Checklist

  • Write + run tests
  • Update CHANGELOG and increment version
  • Update README and relevant documentation

@nnichols nnichols requested a review from a team as a code owner June 11, 2023 18:47
@WallBrewBot WallBrewBot added documentation Improvements or additions to documentation source code Updates to the application or library source code test code Updates to the application or library test code labels Jun 11, 2023
Copy link
Contributor

@WallBrewBot WallBrewBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

misspell

src/brewtility/units/options.cljc|192 col 9| "litre" is a misspelling of "liter"
src/brewtility/units/options.cljc|194 col 9| "millilitre" is a misspelling of "milliliter"
src/brewtility/units/options.cljc|323 col 15| "litre" is a misspelling of "liter"
src/brewtility/units/options.cljc|327 col 5| "litre" is a misspelling of "liter"
src/brewtility/units/options.cljc|331 col 15| "litre" is a misspelling of "liter"
src/brewtility/units/options.cljc|332 col 3| "litre" is a misspelling of "liter"
src/brewtility/units/options.cljc|339 col 15| "millilitre" is a misspelling of "milliliter"
src/brewtility/units/options.cljc|343 col 5| "millilitre" is a misspelling of "milliliter"
src/brewtility/units/options.cljc|347 col 15| "millilitre" is a misspelling of "milliliter"
src/brewtility/units/options.cljc|348 col 3| "millilitre" is a misspelling of "milliliter"
src/brewtility/calculations.cljc|31 col 67| "litre" is a misspelling of "liter"
src/brewtility/calculations.cljc|100 col 57| "litre" is a misspelling of "liter"
src/brewtility/calculations.cljc|193 col 61| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|22 col 27| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|23 col 33| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|24 col 38| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|25 col 50| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|26 col 49| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|27 col 39| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|35 col 69| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|36 col 48| "litre" is a misspelling of "liter"
test/brewtility/units/volume_test.cljc|38 col 74| "millilitre" is a misspelling of "milliliter"
test/brewtility/units/volume_test.cljc|104 col 36| "litre" is a misspelling of "liter"
test/brewtility/units_test.cljc|15 col 62| "litre" is a misspelling of "liter"
test/brewtility/units_test.cljc|16 col 55| "litre" is a misspelling of "liter"
test/brewtility/units_test.cljc|16 col 69| "litre" is a misspelling of "liter"
test/brewtility/units_test.cljc|153 col 86| "litre" is a misspelling of "liter"
test/brewtility/units_test.cljc|154 col 65| "litre" is a misspelling of "liter"
test/brewtility/units_test.cljc|156 col 91| "millilitre" is a misspelling of "milliliter"
test/brewtility/units_test.cljc|325 col 53| "litre" is a misspelling of "liter"

doc/patterns/symbolic_keywords.md Outdated Show resolved Hide resolved
doc/api/units.md Show resolved Hide resolved
doc/api/units.md Outdated Show resolved Hide resolved
doc/api/units.md Show resolved Hide resolved
doc/api/units.md Show resolved Hide resolved
src/brewtility/units/time.cljc Show resolved Hide resolved
src/brewtility/units/time.cljc Show resolved Hide resolved
src/brewtility/units/time.cljc Show resolved Hide resolved
src/brewtility/units/time.cljc Show resolved Hide resolved
src/brewtility/units/temperature.cljc Outdated Show resolved Hide resolved
- [imperial-pint](https://en.wikipedia.org/wiki/Pint)
- [imperial-quart](https://en.wikipedia.org/wiki/Quart)
- [liter](https://en.wikipedia.org/wiki/Litre)
- [litre](https://en.wikipedia.org/wiki/Litre)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

- [liter](https://en.wikipedia.org/wiki/Litre)
- [litre](https://en.wikipedia.org/wiki/Litre)
- [milliliter](https://en.wikipedia.org/wiki/Millilitre)
- [millilitre](https://en.wikipedia.org/wiki/Millilitre)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"millilitre" is a misspelling of "milliliter"

"The [liter](https://en.wikipedia.org/wiki/Liter) unit of measure.

Commonly used with `brewtility.units` and in argument/option maps.
Note: Both `litre` and `liter` are valid keys throughout brewtility to support regional spelling."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

:liter)


(def litre
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

"The [liter](https://en.wikipedia.org/wiki/Litre) unit of measure.

Commonly used with `brewtility.units` and in argument/option maps.
Note: Both `litre` and `liter` are valid keys throughout brewtility to support regional spelling."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

(is (= 12.0 (bp/->3dp (sut/convert-volume 9.99209 :imperial-pint :american-pint))))))
(testing "Volume conversions should behave as expected."
(is (= 1.0 (sut/convert :volume 1.0 options/liter options/litre)))
(is (= 1.0 (sut/convert options/volume 1.0 options/litre options/litre)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

(is (= 1008000.0 (precision/->2dp (sut/convert options/time 100.0 options/week options/minute)))))
(testing "Volume:"
(is (= 100.0
(precision/->2dp (sut/convert options/volume 100.0 options/liter options/litre))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

(testing "Volume:"
(is (= 100.0
(precision/->2dp (sut/convert options/volume 100.0 options/liter options/litre))
(precision/->2dp (sut/convert options/volume 100.0 :litre :liter))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

(precision/->2dp (sut/convert options/volume 100.0 options/liter options/litre))
(precision/->2dp (sut/convert options/volume 100.0 :litre :liter))))
(is (= 100.0
(precision/->2dp (sut/convert options/volume 100.0 options/milliliter options/millilitre))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"millilitre" is a misspelling of "milliliter"

(testing "Volume:"
(is (= "1.5 l"
(sut/display options/volume 1.5 :liter)
(sut/display options/volume 1.5 options/litre)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"litre" is a misspelling of "liter"

@nnichols nnichols merged commit 776f29f into master Jun 11, 2023
13 checks passed
@nnichols nnichols deleted the wb-29-units-of-measure branch June 11, 2023 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation source code Updates to the application or library source code test code Updates to the application or library test code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants