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

Cleanup and improvements in unit mapping #290

Merged
merged 4 commits into from
Nov 9, 2021
Merged

Cleanup and improvements in unit mapping #290

merged 4 commits into from
Nov 9, 2021

Conversation

Enchufa2
Copy link
Member

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:

  • Thin wrappers around udunits2 functions, following the name convention R_<udunits2_name>, e.g., R_ut_parse.
  • More high-level functions, following the name convention ud_<something>, e.g., ud_convert.

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

@Enchufa2 Enchufa2 requested a review from edzer October 16, 2021 18:56
@codecov
Copy link

codecov bot commented Oct 16, 2021

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%) ⬇️
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
Copy link
Member Author

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

@Enchufa2
Copy link
Member Author

Enchufa2 commented Nov 3, 2021

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

@Enchufa2 Enchufa2 merged commit c7e5008 into master Nov 9, 2021
@Enchufa2 Enchufa2 deleted the cleanup branch November 9, 2021 07:48
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.

1 participant