-
Notifications
You must be signed in to change notification settings - Fork 26
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 for #307 #308
Merged
Merged
fix for #307 #308
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9d0062a
change the order of to_string processing for meters and seconds to ma…
phlptp dc45761
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 97ac486
code comments and switch second order
phlptp 40024e5
Merge branch 'meters_second_fix' of https://github.com/LLNL/units int…
phlptp 2f898c8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b20621e
fix suppressions
phlptp b20477b
add a few more tests
phlptp cceacf9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
unusedFunction:units/x12_conv.cpp:1024 | ||
unusedFunction:units/r20_conv.cpp:2738 | ||
unusedFunction:units/x12_conv.cpp:1009 | ||
passedByValue:units/units.cpp:222 | ||
passedByValue:units/units.cpp:1154 | ||
passedByValue:units/units.cpp:1171 | ||
passedByValue:units/units.cpp:224 | ||
passedByValue:units/units.cpp:1156 | ||
passedByValue:units/units.cpp:1173 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you checked if these are the only examples, or is this part of a wider class of regressions that was introduced recently?
For example,
km/s
currently also formats askHz*m
, is this also fixed by the change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cause of this issue is a combination of two things. The first being a check taking a single base unit away from the unit, and 'm' was first in the list. so the remaining portions of the unit were then converted in isolation and since 1/s=Hz it also adds any prefix, by swapping the order to dealing with 's' first it takes care combinations of 'm' and 's' a bit better. So as best as I can tell the only types of unit this issue is affecting is combinations of 'meter' and 'second' so yes it also fixes fixes km/s. and gray being m^2/s^2 is a bit of quirk as well, that comes from handling meters in this fashion before s^2 so adding that check first solves that issue as well.