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

Add type hints to callback, compat, and config.py #7603

Closed
wants to merge 2 commits into from

Conversation

jjwang01
Copy link

Adding type hints to callback.py, compat.py, and config.py as part of #6496.

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, could you please take a look into the failing tests?

I think adding types to callback might be tricky at the moment as we haven't exposed the packed booster to the public interface yet.

@jjwang01
Copy link
Author

Yep, looks like all the error traces are complaining about the _PackedBooster object. Perhaps I should set the type hints for the respective variables I've added _PackedBooster hints to as Any? I believe that only Booster will cause a compile time error with the _PackedBooster object.

@trivialfis
Copy link
Member

@jjwang01 Can we revert the changes in callback.py and keep the remaining? I plan to improve the packed booster and expose it to the public in the future. So right now we might just leave it as it's.

@trivialfis
Copy link
Member

Closing as these modules are fully typed.

@trivialfis trivialfis closed this Jul 28, 2022
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.

2 participants