ferraridamiano / units_converter

Pure Dart package to easily convert units of mesurement, numeral systems and custom units.
https://pub.dev/packages/units_converter
MIT License
29 stars 15 forks source link

Added MolarMass, MolarVolume, InverseToMolarMass, and some extra Densities #33

Closed Dokotela closed 1 year ago

Dokotela commented 1 year ago

Added new properties

I also added some more densities.

I've added tests for all of the above, but some of the conversion tests for MOLAR_VOLUME don't quite work the way I want them to. For instance: MOLAR_VOLUME.nanoMolesPerMilliLiter: 999999.9999999999 But should be: MOLAR_VOLUME.nanoMolesPerMilliLiter: 1000000

Any recommendations on where I went wrong?

codecov-commenter commented 1 year ago

Codecov Report

Base: 99.75% // Head: 99.77% // Increases project coverage by +0.02% :tada:

Coverage data is based on head (8fc91b2) compared to base (6382514). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #33 +/- ## ========================================== + Coverage 99.75% 99.77% +0.02% ========================================== Files 28 31 +3 Lines 803 905 +102 ========================================== + Hits 801 903 +102 Misses 2 2 ``` | [Impacted Files](https://codecov.io/gh/ferraridamiano/units_converter/pull/33?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari) | Coverage Δ | | |---|---|---| | [lib/properties/amount\_of\_substance.dart](https://codecov.io/gh/ferraridamiano/units_converter/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari#diff-bGliL3Byb3BlcnRpZXMvYW1vdW50X29mX3N1YnN0YW5jZS5kYXJ0) | `100.00% <ø> (ø)` | | | [lib/properties/density.dart](https://codecov.io/gh/ferraridamiano/units_converter/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari#diff-bGliL3Byb3BlcnRpZXMvZGVuc2l0eS5kYXJ0) | `100.00% <100.00%> (ø)` | | | [lib/properties/molar\_mass.dart](https://codecov.io/gh/ferraridamiano/units_converter/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari#diff-bGliL3Byb3BlcnRpZXMvbW9sYXJfbWFzcy5kYXJ0) | `100.00% <100.00%> (ø)` | | | [lib/properties/molar\_volume.dart](https://codecov.io/gh/ferraridamiano/units_converter/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari#diff-bGliL3Byb3BlcnRpZXMvbW9sYXJfdm9sdW1lLmRhcnQ=) | `100.00% <100.00%> (ø)` | | | [lib/properties/reciprocal\_of\_molar\_mass.dart](https://codecov.io/gh/ferraridamiano/units_converter/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari#diff-bGliL3Byb3BlcnRpZXMvcmVjaXByb2NhbF9vZl9tb2xhcl9tYXNzLmRhcnQ=) | `100.00% <100.00%> (ø)` | | | [lib/utils/utils.dart](https://codecov.io/gh/ferraridamiano/units_converter/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari#diff-bGliL3V0aWxzL3V0aWxzLmRhcnQ=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Damiano+Ferrari)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

ferraridamiano commented 1 year ago

Hi @Dokotela and thank you for another wonderful PR! I'm going to review it and commit if needed! Don't worry too much about that calculations problem. Hope to finish the review today

Dokotela commented 1 year ago

Above recommendations should be fixed.

Reciprocal of molar mass isn't used in normal chemistry (at least I haven't seen it), but is used in medicine.

If a patient needs 12 mmol of something, and the medication comes in 3 mmol/gram, you need to order 4 grams. Obviously a simple example.

ferraridamiano commented 1 year ago

Perfect, thank you very much @Dokotela! I will soon publish a new release with all your new units!