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

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

Merged
merged 8 commits into from
Jul 5, 2024

Commits on Jun 30, 2024

  1. Switched to using raw strings, thus removing the need for W605.

    In python 3.12 these are now Syntax Errors instead of Deprecation warnings.
    bramp committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    8e49868 View commit details
    Browse the repository at this point in the history
  2. Remove the {default,constants}_en.txt files and now use the defaults …

    …that come with pint.
    bramp committed Jun 30, 2024
    Configuration menu
    Copy the full SHA
    8ea2906 View commit details
    Browse the repository at this point in the history

Commits on Jul 1, 2024

  1. Configuration menu
    Copy the full SHA
    f245282 View commit details
    Browse the repository at this point in the history
  2. Fixed a couple of unit tests to use a regular minus sign, instead of …

    …a unify dash.
    
    The tests previously weren't working correctly. Specifically when doing Quantity('-123') with a unify dash, pint would actually return the Quantity('123'). The test doesn't catch this, as the test is effectively doing Quantity($input) == Quantity($input).
    
    With Python 3.12, the internals of Quantity changed, to explictly reject unify dashes, instead of silently skipping them.
    bramp committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    1327a5b View commit details
    Browse the repository at this point in the history
  3. Change tests to use ppm instead of parts_per_million.

    In pint 0.21 ppm was officially added, named ppm, instead of parts_per_million.
    bramp committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    f12e2c6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b4c2ce1 View commit details
    Browse the repository at this point in the history
  5. Improve the parsing of list of quantities, and allow the parsing of p…

    …ercentage values.
    
    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.
    bramp committed Jul 1, 2024
    Configuration menu
    Copy the full SHA
    1a990ae View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2024

  1. Configuration menu
    Copy the full SHA
    6629b6b View commit details
    Browse the repository at this point in the history