ENH Support type hinting using mypy#68
Conversation
|
Hi @illumination-k, thanks a lot for your work! This is our first contribution from an external collaborator, we're very excited about it :). I have just approved the CI to run on this PR. It seems that some checks have failed, could you have a look at it if you have time? FYI I'll be away next week so your interlocutor will probably be @maikia. Thanks again for your help, hope to merge this soon! |
|
Sorry for failing CI. I ran CI and pre-commit scripts manually and maybe OK. If failed, I will check tomorrow. |
|
Hi @illumination-k |
|
Sorry @maikia, I missed your comments. I removed |
maikia
left a comment
There was a problem hiding this comment.
@illumination-k thanks again for your contribution. Very nice and through PR.
Could you provide me with the details on your settings of mypy, or even better if you can add it to the CI (and I will reproduce the steps locally).
ATM if I run naive mypy it fails with errors, eg

To my knowledge those errors can also be coming from the version of Python. The one I am using locally (as well as the one used in our CI) is 3.8.
I also didn’t realise before but api/docstrings should also be removed from the PR, and yes, adding this as well as auto examples to .gitignore is a great idea. Feel free to open a new PR if you like.
|
I used Python 3.10, and you are right python 3.8 dose not support direct list, tuple. Now I fixed type hinting for Python 3.8 |
erge branch 'main' into feature/mypy
maikia
left a comment
There was a problem hiding this comment.
@illumination-k thanks again for your PR! I extended it to have mypy running within CI and corrected a bug coming from one of the changes in the code. Can you please make sure that you agree with all the changes I did?
@BorisMuzellec @mandreux-owkin can one of you review before merge (as I committed to this PR I prefer that there is someone else checking if all is good, thx)
BorisMuzellec
left a comment
There was a problem hiding this comment.
LGTM, up to minor suggestions.
Thanks a lot @illumination-k (and @maikia) for the work!
|
Hi, now that the AnnData integration has been merged, there will be numerous merge conflicts to resolve. I'll handle them, if that's OK for you. |
|
Sure! Sorry for my late response, @BorisMuzellec . |
|
Your commit maybe inactivated type hinting. There are many Would it be better to close this PR and create a new one, or create new commit in this PR? |
|
Hi @illumination-k, indeed, thanks for checking! It seems like I made some git manipulation mistakes, sorry for that... I don't think it's necessary to close this PR. I'll just revert to where it was before I made changes and take it from there. We'll squash anyways at merge time. |
maikia
left a comment
There was a problem hiding this comment.
This PR did grow quite a bit. LGTM. just few minor comments.
@illumination-k can you also comment if you agree with all the changes done to your PR?
|
@BorisMuzellec there are also some conflicts needing resolve |
Yes, I am currently handling those. These are due to the anndata merge |
|
I would prefer to address We should address anndata typing and |
|
Hi @illumination-k and @maikia, I did my best to pass the the I agree with @illumination-k that we should deal with more intricate typing issues brought by the |
|
@BorisMuzellec I left some comments in my previous review which were still not addressed. Otherwise I agree with your last comment |
mypymypy
|
@illumination-k and @maikia since all comments are now resolved, unless there is something else you would like to change I'll merge this PR today |
Reference Issue or PRs
Please see #39
What does your PR implement? Be specific.
This PR support type hinting by
mypyand fixed some docstring which incompatible withmypytype checking.