mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
Autogenerated type safety parameterisation of all methods
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user