Autogenerated type safety parameterisation of all methods

This commit is contained in:
Ian Renton
2026-09-20 20:02:19 +01:00
parent 6037e742cc
commit 324dd1414b
132 changed files with 1228 additions and 706 deletions
+10 -3
View File
@@ -1,9 +1,12 @@
from __future__ import annotations
from core.constants import BANDS
from data.band import Band
HF_BANDS = [b for b in BANDS if b.is_ham_hf]
HF_BANDS: list[Band] = [b for b in BANDS if b.is_ham_hf]
def _latest(d) -> float | None:
def _latest(d: dict[float, float | str] | None) -> float | None:
"""Given a map where the key is a timestamp and the value is a number represented as a string, find the latest
timestamp and return the corresponding value as a float."""
@@ -11,7 +14,11 @@ def _latest(d) -> float | None:
return float(val) if (val is not None and val != "None") else None
def compute_band_states(fof2_dict, muf_dict, luf_dict):
def compute_band_states(
fof2_dict: dict[float, float | str] | None,
muf_dict: dict[float, float | str] | None,
luf_dict: dict[float, float | str] | None,
) -> dict[str, str]:
"""Compute HF band states from the latest foF2, MUF and LUF values.
Returns a map where the keys are HF bands and the values are as follows: