Use relative errors by default when comparing output files#449
Open
PhilipFackler wants to merge 1 commit into
Open
Use relative errors by default when comparing output files#449PhilipFackler wants to merge 1 commit into
PhilipFackler wants to merge 1 commit into
Conversation
lukelowry
reviewed
Jun 12, 2026
lukelowry
left a comment
Collaborator
There was a problem hiding this comment.
Just some comments. Thank you for making my life easier for validation. Much appreciated
| * @brief Aggregate norm data for a single variable over time | ||
| */ | ||
| struct ErrorAggregate | ||
| struct TemporalNormAggregate |
Collaborator
There was a problem hiding this comment.
I approve of this vocabulary
| const std::string& test_file, | ||
| const std::string& reference_file, | ||
| ErrorType error_type = ErrorType::RELATIVE, | ||
| double abs_threshold = DEFAULT_ABS_ERROR_THRESHOLD); |
Collaborator
There was a problem hiding this comment.
Instead of abs_threshold how about err_threshold since the type can change?
Collaborator
Author
There was a problem hiding this comment.
This is specific to computing relative error. If the reference value is lower than the threshold, you don't scale, so you switch to absolute.
This file contains hidden or 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
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.
Description
Enable relative and absolute errors (for CSV comparison) and use relative by default.
Closes #368
Proposed changes
This enables aggregating absolute errors or relative errors. Optional parameters are added to the JSON solver input file. Scaling relative errors depends on the optional parameter "abs_err_threshold" below which the errors will switch to absolute (so we don't divide by zero).
Checklist
-Wall -Wpedantic -Wconversion -Wextra.