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

Type annotations & code refactor #704

Closed
wants to merge 5 commits into from

Conversation

DanielAvdar
Copy link
Contributor

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.

Copy link
Contributor

@pplonski pplonski left a 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,
Copy link
Contributor

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?

Copy link
Contributor Author

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,
Copy link
Contributor

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],
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@DanielAvdar
Copy link
Contributor Author

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 ?

@DanielAvdar DanielAvdar closed this Feb 5, 2024
@pplonski
Copy link
Contributor

Thank you! That would be great. I'm using black for code formatting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants