-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improve Test Stability & Minor fixes to documentation #39
Merged
Conversation
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 method for calculating ULP distance - Let the UtilityStructs use this method - create custom matcher for comparing 2D containers
This improves the stability of the tests and makes them independent of the utilized OS/ Compiler/ Architecture by: - adding dedicated methods for FloatingPoint comparison using - UPL distance - Relative Epsilon - adding custom GoogleTestMatchers using these new methods - updating the DataStructures Equality methods
Improved the code comments for better clarity and updated some of the examples in the docs. Also corrected minor typos in documentation and comments. The package version number is updated to 3.1.
schuhmaj
changed the title
Improve Test Stability & Minor fixes to documentation
WIP: Improve Test Stability & Minor fixes to documentation
May 7, 2024
schuhmaj
changed the title
WIP: Improve Test Stability & Minor fixes to documentation
Improve Test Stability & Minor fixes to documentation
May 8, 2024
gomezzz
requested changes
May 8, 2024
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.
Mostly looks good, but I believe there is a tiny bug in the relative error :P
gomezzz
approved these changes
May 8, 2024
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.
👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Changelog
Rational
Our macOS GitHub Action is broken. The runner's environment probably changed somehow.
The tests comparing the calculation's intermediate results to the values yielded by Tsoulis Fortran implementation were implemented using
ContainerEq
fromGoogleTest
.While this is syntactically nice, it only accounts for real equality - which breaks if the compiler/ platform is different and the values deviate by some tiny fractions more.
Changes
almostEqualUlps
andalmostEqualRelative
for floating point comparisonalmostEqualUlps
compare two floating points by computing the ULP Distance (basically, re-interpreting them asintegers
and then computing the difference yields the distance how "far" the two floats are from each other). Equal are floats by default withULP Distance <= 4
almostEqualRelative
compares two floating points by relative comparison with the defaultEPSILON = 1e-10
FloatContainter1D
,FloatContainter2D
andFloatContainter3D
to be used withGoogleTest
'sASSERT_THAT
statement to compare nested containers of floating points valuesoperator==
ofHessianPlane
,TranscendentalExpression
andDistance
now use the new equalitiesJOSS Paper
3.x
(we don't have a UML calculation component anymore!) (The diagram embedded below is a.png
file; the one in the repository is a.pdf
with a higher DPI/ quality)