casact / chainladder-python

Actuarial reserving in Python
https://chainladder-python.readthedocs.io/en/latest/
Mozilla Public License 2.0
192 stars 71 forks source link

Add type annotations where useful (constructors, methods, functions, etc.) #486

Open MatthewCaseres opened 10 months ago

MatthewCaseres commented 10 months ago

Is your feature request related to a problem? Please describe. When typing out arguments I want to see what I should be passing in.

Is your feature request at odds with the scope of the package? dont think so

Describe the solution you'd like Put type annotations so that there are minimal "Any" in this screenshot

Screenshot 2024-01-17 at 7 59 25 PM

Describe alternatives you've considered Letting the code remain as it is.

Additional context

Currently there is no minimal version of Python in setup.py. Type annotations are from 3.5, so it might be worthwhile to add this as requirement.

Ideally the type annotation for origin_grain is Literal['Y', 'S', 'Q', 'M'], and typing.Literal is from 3.8, and 3.8 is also the earliest version that is not end of life - https://devguide.python.org/versions/. So I want to add an earliest Python version to setup.py and make it 3.8.

genedan commented 6 months ago

I'll take this one on.