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

Decrease warning levels #20

Merged
merged 3 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/griddeddata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void GridAxis::calc_spacing_multipliers() {
// If you are sitting at the "0" along an edge of the hypercube, you want the "0" flavof
if (grid.size() == 1) {
set_interp_method(Method::LINEAR);
showMessage(MsgLevel::MSG_WARN, "A cubic interpolation method is not valid for grid axes with only one value. Interpolation method reset to linear.");
showMessage(MsgLevel::MSG_INFO, "A cubic interpolation method is not valid for grid axes with only one value. Interpolation method reset to linear.");
}
double center_spacing;
for (std::size_t i = 0; i < grid.size() - 1; i++) {
Expand All @@ -79,11 +79,11 @@ void GridAxis::check_grid_sorted() {

void GridAxis::check_extrap_limits() {
if (extrapolation_limits.first > grid[0]) {
showMessage(MsgLevel::MSG_WARN, stringify("The lower extrapolation limit (", extrapolation_limits.first,") is within the set of grid values. Setting to smallest grid value (", grid[0],")."));
showMessage(MsgLevel::MSG_INFO, stringify("The lower extrapolation limit (", extrapolation_limits.first,") is within the set of grid values. Setting to smallest grid value (", grid[0],")."));
extrapolation_limits.first = grid[0];
}
if (extrapolation_limits.second < grid.back()) {
showMessage(MsgLevel::MSG_WARN, stringify("The upper extrapolation limit (", extrapolation_limits.first,") is within the set of grid values. Setting to largest grid value (", grid.back(),")."));
showMessage(MsgLevel::MSG_INFO, stringify("The upper extrapolation limit (", extrapolation_limits.first,") is within the set of grid values. Setting to largest grid value (", grid.back(),")."));
extrapolation_limits.second = grid.back();
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/griddeddata_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ TEST(GridAxis, calc_spacing_multipliers) {
TEST(GridAxis, bad_limits) {
GridAxis my_grid_axis({0, 5, 7, 11, 12, 15});
std::pair<double, double> extrap_limits{4, 17};
std::string ExpectedOut = " WARNING: The lower extrapolation limit (4) is within the set of "
std::string ExpectedOut = " NOTE: The lower extrapolation limit (4) is within the set of "
"grid values. Setting to smallest grid value (0).\n";
EXPECT_STDOUT(my_grid_axis.set_extrap_limits(extrap_limits);, ExpectedOut);
EXPECT_EQ(my_grid_axis.extrapolation_limits.first, 0);

extrap_limits = {-2, 12};
ExpectedOut = " WARNING: The upper extrapolation limit (-2) is within the set of grid values. "
ExpectedOut = " NOTE: The upper extrapolation limit (-2) is within the set of grid values. "
"Setting to largest grid value (15).\n";
EXPECT_STDOUT(my_grid_axis.set_extrap_limits(extrap_limits);, ExpectedOut);
EXPECT_EQ(my_grid_axis.extrapolation_limits.second, 15);
Expand Down