-
Notifications
You must be signed in to change notification settings - Fork 416
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
Type annotations & code refactor #704
Conversation
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.
Thank you for PR! I think some of the formatting is not needed and changes in packages names.
sample_weight_validation=None, | ||
log_to_file=None, | ||
max_time=None, | ||
self, |
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.
why are you adding spaces?
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 automatic reformatting by the IDE.
metric_name=None, | ||
ml_task=None, | ||
explain_level=2, | ||
self, |
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.
spaces again?
Union[numpy.ndarray, pandas.Series, pandas.DataFrame] | ||
] = None, | ||
self, | ||
X: Union[np.ndarray, pd.DataFrame], |
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.
why you changed numpy
to np
and pandas
to pd
?
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.
These aliases have become standardized within the Python data science community, so you'll often see them used in tutorials, documentation, and code examples. It's not a mandatory change, but it's a widely accepted convention that helps improve code readability and efficiency.
I will open a new PR with the desired changes. I'd like to emphasize that it's possible to enforce code styling using pylint. Furthermore, we can add a code style check to the PR. Is that something you would like @pplonski ? |
Thank you! That would be great. I'm using |
Type annotations contribute significantly to code readability, facilitate code completion, and highlight type incompatibility issues. Please wait for checks to complete to ensure annotations are compatible with all Python versions.