Autogenerated type safety parameterisation of all methods

This commit is contained in:
Ian Renton
2026-09-20 20:16:31 +01:00
parent 324dd1414b
commit 93ea27510f
131 changed files with 20 additions and 283 deletions
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from core.enums import ActivityName
from data.activities import ACTIVITIES
from data.activity import Activity
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import re
from core.data_providers import DATA_PROVIDERS
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from threading import Event, Thread
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import importlib
import logging
import os
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from core.config import SERVER_OWNER_CALLSIGN
from data.band import Band
+11 -6
View File
@@ -3,14 +3,19 @@ from __future__ import annotations
import logging
import threading
import time
from typing import TYPE_CHECKING
from core.config import config, create_provider_from_config
from providers.activityrefdata.activity_ref_data_provider import ActivityRefDataProvider
from providers.alert.alert_provider import AlertProvider
from providers.callsigndata.callsign_data_provider import CallsignDataProvider
from providers.solarconditions.solar_conditions_provider import SolarConditionsProvider
from providers.spot.spot_provider import SpotProvider
from providers.staticdata.static_data_provider import StaticDataProvider
if TYPE_CHECKING:
# Can't find a way to resolve the circular dependency on types but apparently this is a way of managing that
# while still having type safety in method definitions.
from providers.activityrefdata.activity_ref_data_provider import ActivityRefDataProvider
from providers.alert.alert_provider import AlertProvider
from providers.callsigndata.callsign_data_provider import CallsignDataProvider
from providers.solarconditions.solar_conditions_provider import SolarConditionsProvider
from providers.spot.spot_provider import SpotProvider
from providers.staticdata.static_data_provider import StaticDataProvider
logger = logging.getLogger(__name__)
+1 -3
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from enum import Enum
@@ -46,7 +44,7 @@ class Mode(str, Enum):
return not (self.is_cw or self.is_phone)
@staticmethod
def from_name(name: str) -> Mode | None:
def from_name(name: str) -> "Mode | None":
"""Convert a string to an enum mode using the alias table."""
if not name:
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
from math import floor, isnan
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import threading
import time
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from prometheus_client import (
CollectorRegistry,
Counter,
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import threading
from typing import Generic, TypeVar
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import os
from datetime import datetime
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import threading
from datetime import timedelta
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
from typing import Any