Closed mlincett closed 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.
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).
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
andlist
type annotations.To summarise the changes, they mostly fall in one of these categories:
subclasses
dictionary we use in severalflarestack.core
functionalities;Optional[T]
for variables that can be of typeT
orNone
; on the long term, conditional statements based onNone
values should be likely deprecated;misc
orutils
that are no longer compatible with the current flarestack core API and that are evidently untested (otherwise their test would fail);x = np.array(x)
since a variable should not change its type; this may seem a bit too strict but on the long term it improves clarity.