icecube / flarestack

Unbinned likelihood analysis code for astroparticle physics datasets
https://flarestack.readthedocs.io/en/latest/?badge=latest
MIT License
8 stars 7 forks source link

Support static type checking with `mypy` #302

Closed mlincett closed 1 year ago

mlincett commented 1 year ago

This PR provides a minimal set of change to let a mypy run pass on the current codebase. The primary reason for this is to allow the use of mypy to test improvements and refactors of the existing code.

Note that mypy (in my understanding) checks for type consistency only functions that have a typed return value, and optionally all functions with at least one type annotation even if untyped. It also does more general QC, function signature-based syntax checking. Notably it does not like variable name re-definitions.

This PR also deprecates python 3.8 and closes #301 so we can use native tuple and list type annotations.

To summarise the changes, they mostly fall in one of these categories:

robertdstein commented 1 year ago

I updated the CI. It's under settings, then Branch protection rules. I removed python 3.8, and added python 3.11, as a required check.

mlincett commented 1 year ago

I updated the CI. It's under settings, then Branch protection rules. I removed python 3.8, and added python 3.11, as a required check.

Looked for it but could not find it. Apparently I don't have high enough privileges (I guess).