r-quantities / units

Measurement units for R
https://r-quantities.github.io/units
173 stars 27 forks source link

Cleanup and improvements in unit mapping #290

Closed Enchufa2 closed 2 years ago

Enchufa2 commented 2 years ago

Before tackling #289, I realized that unit mapping was not entirely correct: we were mapping symbols/names to units, but not units to symbol/names, and apparently both are required. This PR solves this.

I've also cleaned up the C interface by distinguishing two kinds of functions:

Finally, I've removed deprecated functions and created a man page specifically to document all the defunct ones.

codecov[bot] commented 2 years ago

Codecov Report

Merging #290 (6e7d3ad) into master (c77471a) will decrease coverage by 1.30%. The diff coverage is 91.56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #290      +/-   ##
==========================================
- Coverage   94.42%   93.12%   -1.31%     
==========================================
  Files          18       18              
  Lines         879      858      -21     
==========================================
- Hits          830      799      -31     
- Misses         49       59      +10     
Impacted Files Coverage Δ
R/database.R 80.55% <0.00%> (ø)
R/make_units.R 89.83% <ø> (ø)
R/init.R 9.09% <50.00%> (ø)
src/udunits.cpp 90.19% <93.33%> (-9.81%) :arrow_down:
R/udunits.R 100.00% <100.00%> (ø)
R/user_conversion.R 87.50% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c77471a...6e7d3ad. Read the comment docs.

Enchufa2 commented 2 years ago

Codecov complains, but the few lines without coverage are on purpose.

Enchufa2 commented 2 years ago

@edzer Kind reminder. :) Did you have time to take a look?