-
Notifications
You must be signed in to change notification settings - Fork 228
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
Hide Pysmo warnings in tests #1428
Conversation
# TODO: Missing doc strings | ||
# pylint: disable=missing-module-docstring | ||
# pylint: disable=missing-function-docstring |
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.
Can we get rid of these Pylint disables now?
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.
I wasn't looking at that, but sure should be an easy fix while I'm breaking things in those files
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.
Overall looks reasonable, some lines are commented out but not removed. If this is so they can be unhidden later, then they are fine.
@staticmethod | ||
def print_fun(x, f, accepted): | ||
print("at minimum %.4f accepted %d" % (f, int(accepted))) | ||
# @staticmethod |
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.
Commented code
print( | ||
"\n===========================Polynomial Regression===============================================\n" | ||
) | ||
# print( |
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.
Commented code
# print( | ||
# "\n===========================Polynomial Regression===============================================\n" | ||
# ) | ||
_log.info("Polynomial Regression (begin)") | ||
# Checks if fname is provided or exists in the path | ||
if not isinstance(overwrite, bool): | ||
# PYLINT-TODO |
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.
pylint disable-next=broad-exception-raised
is used in a few places in this file, are they still necessary?
'".\n', | ||
_log.warning( | ||
f"Warning: '{fname}' exists, " | ||
f"results will be saved to {self.filename}" | ||
) | ||
# self.filename = 'solution.pickle' |
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.
This is commented, but seems like it was already commented out before this PR.
) | ||
self.number_of_crossvalidations = number_of_crossvalidations | ||
# warnings.warn(msg) |
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.
Same here, commented out line
) | ||
maximum_polynomial_order = 10 | ||
self.max_polynomial_order = maximum_polynomial_order | ||
# warnings.warn(msg) |
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.
Here too
@@ -1274,11 +1293,12 @@ def polynomial_regression_fitting(self, additional_regression_features=None): | |||
< self.original_data.shape[0] | |||
) | |||
): | |||
print("\n-------------------------------------------------") | |||
print("\nIteration ", iteration_number) | |||
# print("\n-------------------------------------------------") |
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.
Here as well
" / MSE: %4f" % mse_error_opt, | ||
" / R_sq: %4f" % r_square_opt, | ||
" / Adjusted R^2: %4f" % r_square_adj_opt, | ||
# print( |
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.
And here
KrigingClass.print_fun(1, 2, 3.7) | ||
sys.stdout = sys.__stdout__ | ||
assert "at minimum 2.0000 accepted 3\n" == capturedOutput.getvalue() | ||
# @pytest.mark.unit |
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.
Was this left commented on purpose, or can this be removed?
@@ -1647,7 +1661,7 @@ def test_results_generation_01(self, array_type1, array_type2): | |||
row_list = np.array([["k"], ["(x_1)^1"], ["(x_2)^1"]]) | |||
expected_df = pd.concat( | |||
[ | |||
expected_df, | |||
#expected_df, |
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.
Commented here, and in a couple places farther down in this file
Superseded by #1472 |
Fixes #1421
Summary/Motivation:
They are annoying
Changes proposed in this PR:
pylint-disable
commentsLegal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: