-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
Using Python type hints #2550
Comments
I guess we should add a mypy test stage |
This would also allow us to remove sphinx type annotations, if we were to use https://pypi.org/project/sphinx-autodoc-typehints/ |
Can I work on this issue? Adding type hints to the existing codebase? Maybe not the entire codebase in a PR, but at least some sections of it. Then subsequent PR's could cover the codebase. |
Hi @kamathhrishi, sure, we'd appreciate any help! I especially like the idea of a bunch of small easy-to-review PRs that add type hints to one module at a time. |
Thank you @fritzo. I have made a PR for optim module. Review it and let me know. I am new to the codebase and would like to take this as a starting step. |
It looks like we should also add
|
Can I take a look at parts of this? I can open a PR for |
Since Pyro supports exclusively Python 3, we should look into adding type hints. This has a few advantages:
e.g.
Add type hints to modules
pyro.nn.module
#3337pyro.nn.dense_nn
andpyro.nn.auto_reg_nn
#3342param_store.py
type hints #3271warn_unreachable=True
#3312Trace
,TraceMessenger
, &pyro.poutine.guide
#3299pyro.primitives
&poutine.block_messenger
#3292pyro.poutine.messenger
#3290pyro.poutine.runtime
#3288Additional functionality for type hints
Grey might be a good idea for finding #type ignores
The text was updated successfully, but these errors were encountered: