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

fix: correct conversions for volumes, areas #349

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

etienneguevel
Copy link
Contributor

@etienneguevel etienneguevel commented Nov 27, 2024

The quantities used by the eds.quantities pipeline had some wrong unit conversions when calling them.
Exemples :
image

Description

The problem is for units whose absolute degree is superior to one (eg m3, m2 etc.). To correct that the UnitRegistry way of computing the scale is remade with unit_config["scale"] ** abs(unit_config["degree"]) (dm3 have now a scale of 0.001 instead of 0.1 previously).

The changes also rescale the liter unit such as 1l <=> 1dm3, 1ml <=> 1cm3 and that the scale by 10 between different liter units is kept.

Added tests to check that the pipeline eds.quantities correctly make conversions.

Checklist

  • If this PR is a bug fix, the bug is documented in the test suite.
  • Changes were documented in the changelog (pending section).
  • If necessary, changes were made to the documentation (eg new pipeline).

Copy link

sonarcloud bot commented Nov 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants