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

Better support for mypy. #6496

Open
trivialfis opened this issue Dec 13, 2020 · 8 comments
Open

Better support for mypy. #6496

trivialfis opened this issue Dec 13, 2020 · 8 comments

Comments

@trivialfis
Copy link
Member

@trivialfis trivialfis commented Dec 13, 2020

Currently many more Python projects like dask and optuna are using Python type hints. With the Python package of xgboost gaining more and more features, we should also adopt mypy as a safe guard against some type errors and for better code documentation.

@trivialfis
Copy link
Member Author

@trivialfis trivialfis commented Dec 17, 2020

I marked this as good first issue. Adding type checks for Python is an incremental process, parameter by parameter and function by function. It would be a good chance to review existing code base and make improvement during the process. I have made some progress on #6519 with the dask module, which is by far the most dynamic module in xgboost. Other modules can use it as a base line.

Contributions are welcomed!

@trivialfis trivialfis added this to 1.6 in 2.0 Roadmap Oct 21, 2021
@trivialfis trivialfis moved this from 1.6 TO DO to 2.0 in 2.0 Roadmap Nov 14, 2021
@jjwang01
Copy link

@jjwang01 jjwang01 commented Jan 22, 2022

Hi, I was wondering if I could work on this as a first issue. Thanks!

@trivialfis
Copy link
Member Author

@trivialfis trivialfis commented Jan 22, 2022

@jjwang01 Please do. ;-) ping me if you need any help

@jjwang01
Copy link

@jjwang01 jjwang01 commented Jan 23, 2022

Is it alright if I split this into multiple PRs?

@trivialfis
Copy link
Member Author

@trivialfis trivialfis commented Jan 23, 2022

@jjwang01 As many as you need. In fact, it's a good idea to have multiple PRs so we can communicate better around details.

@jjwang01
Copy link

@jjwang01 jjwang01 commented Jan 25, 2022

@trivialfis Is there some sort of local build script that I can use to test locally rather than after submitting a commit to PR?

@jjwang01
Copy link

@jjwang01 jjwang01 commented Feb 2, 2022

Hi, just wanted to follow up on this comment.

@trivialfis
Copy link
Member Author

@trivialfis trivialfis commented Feb 2, 2022

Hi, sorry for missing the message.

  1. Install mypy in your python envorinment.
  2. cd python-package in xgboost source directory.
  3. Run mypy .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2.0 Roadmap
  
2.0 TODO
Development

No branches or pull requests

2 participants