dylanwal / unit_parse

Tool for parsing 'ugly' numbers and units
BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

Improve the parsing of list of quantities, and allow the parsing of percentage values. #12

Closed bramp closed 2 months ago

bramp commented 3 months ago

For example Melting point: 75% -17.5 °C; 80% 4.6 °C; 85% 21 °C. will now return

[Quantity('75%'), Quantity('-17.5 degC')],
[Quantity("80%"), Quantity('4.6 degC')],
[Quantity("85%"), Quantity('21 degC')],

Where previously it returned just Quantity("4.6 degC").

All other examples continue to work the way they did before. But strings such as 10% will also work now.

Fixes https://github.com/dylanwal/unit_parse/issues/10

bramp commented 3 months ago

Oh this change is based on https://github.com/dylanwal/unit_parse/pull/11 (support Python 3.12), but can be rebased to be independent.