msprime icon indicating copy to clipboard operation
msprime copied to clipboard

Type annotations for top-level functions

Open jeromekelleher opened this issue 3 years ago • 4 comments

#1371 added some type annotations for data classes. We should also annotate the top-level functions, as much as we can (some will be a little convoluted).

Also add some documentation on type annotations to the developer docs, noting where we are at and where we'd like to be in the future (basically, all new code should aim to be fully annotated).

jeromekelleher avatar Jan 16 '21 17:01 jeromekelleher

Dropping this for 1.0, it's not worth the extra effort.

jeromekelleher avatar Mar 13 '21 19:03 jeromekelleher

Auto-detecting the types from the test suite worked well when I tried it out on tskit, something worth considering here.

benjeffery avatar Mar 15 '21 15:03 benjeffery

Do you have some links for software for this @benjeffery? It would be nice to do, in the near future, it's just not worth holding up 1.0 for.

jeromekelleher avatar Mar 15 '21 16:03 jeromekelleher

it's just not worth holding up 1.0 for.

Agreed!

https://github.com/dropbox/pyannotate, https://github.com/google/pytype and https://github.com/Instagram/MonkeyType are the projects in this space. A year ago I had success with the first, but things may have moved on.

benjeffery avatar Mar 15 '21 17:03 benjeffery