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

Si matching #173

Merged
merged 21 commits into from
Sep 23, 2021
Merged

Si matching #173

merged 21 commits into from
Sep 23, 2021

Conversation

phlptp
Copy link
Collaborator

@phlptp phlptp commented Sep 20, 2021

add unit domains in an effort to better match SI standards for some specific units.

Add additional documentation

Address Issue #172

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2021

Codecov Report

Merging #173 (9974e6a) into main (b489180) will decrease coverage by 0.64%.
The diff coverage is 77.18%.

@@            Coverage Diff             @@
##             main     #173      +/-   ##
==========================================
- Coverage   98.11%   97.46%   -0.65%     
==========================================
  Files           9        9              
  Lines        4875     5012     +137     
==========================================
+ Hits         4783     4885     +102     
- Misses         92      127      +35     

@phlptp phlptp marked this pull request as ready for review September 20, 2021 23:49
Copy link
Contributor

@SimonHeybrock SimonHeybrock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very promising. 👍

EXPECT_EQ(to_string(unit_from_string("dm")), "dm");

EXPECT_EQ(to_string(unit_from_string("km")), "km");
EXPECT_EQ(to_string(unit_from_string("Km")), "km");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for supporting uppercase K here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct or not I have seen Kg get used in a number of contexts for kilogram. I suppose I could just remove the support for general upper case 'K' here and specifically support Kg

units/units.hpp Outdated
constexpr std::uint32_t cooking{2U};
constexpr std::uint32_t astronomy{4U};
constexpr std::uint32_t nuclear{8U};
constexpr std::uint32_t surveying{9U};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So surveying is ucum and nuclear?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

guess I need to double check the bit sequences again

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tweaked the actual codes a little more a little happier with them but I suspect more revisions will be necessary in future versions.

units/units.cpp Outdated
case 'm':
return 0.001;
case 'k':
case 'K':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually SI?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the capital K from the strict SI for kilo.

@phlptp phlptp merged commit 9fc2d62 into main Sep 23, 2021
@phlptp phlptp deleted the SI_matching branch September 23, 2021 16:12
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.

3 participants