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
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from core.enums import ActivityName, ActivityRefType, ActivityType
from data.activity import Activity
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from dataclasses import dataclass, field
from core.enums import ActivityName, ActivityRefType, ActivityType
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from dataclasses import dataclass
from core.enums import ActivityRefType
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import hashlib
import json
import logging
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from dataclasses import dataclass
from core.enums import Continent, LocationSourceForCallsign
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from dataclasses import dataclass
from tornado.httputil import HTTPHeaders
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import json
from dataclasses import dataclass
from typing import Any, TypeVar
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import hashlib
import json
import logging
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from threading import Event
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import io
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import io
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import io
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from io import BytesIO
from time import sleep
from typing import Any
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from threading import Thread
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any
from core.enums import ActivityName
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from time import sleep
from typing import Any
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from time import sleep
from typing import Any
@@ -1,5 +1,3 @@
from __future__ import annotations
import re
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any
from core.enums import ActivityName
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
import logging
from time import sleep
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
from time import sleep
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from time import sleep
from typing import Any
+2 -8
View File
@@ -1,17 +1,11 @@
from __future__ import annotations
from datetime import datetime
from typing import TYPE_CHECKING, Any
from typing import Any
import pytz
from core.data_store import DATA_STORE
from core.live_data_cache import LiveDataCache
if TYPE_CHECKING:
# Deferred to avoid a circular import: data.alert imports core.call_lookup_helper, which imports
# core.data_providers, which imports this module.
from data.alert import Alert
from data.alert import Alert
class AlertProvider:
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime, timedelta
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
-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
from datetime import date, datetime, time
from typing import Any, cast
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import re
from datetime import datetime
from typing import Any, cast
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
@@ -1,5 +1,3 @@
from __future__ import annotations
import re
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any
from providers.alert.rsgb_ical_alert_provider import RSGBICALAlertProvider
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any
from providers.alert.rsgb_ical_alert_provider import RSGBICALAlertProvider
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any
from icalendar import Event
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from typing import Any, cast
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
@@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any
import diskcache
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import gzip
import logging
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from typing import Any
@@ -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 logging
import urllib.parse
from datetime import datetime, timedelta
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import urllib.parse
from datetime import datetime, timedelta
@@ -1,5 +1,3 @@
from __future__ import annotations
import csv
import logging
from datetime import datetime, timedelta, timezone
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from typing import Any
from xml.etree import ElementTree
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from threading import Event, Thread
@@ -1,5 +1,3 @@
from __future__ import annotations
from core.constants import BANDS
from data.band import Band
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime, timedelta, timezone
from threading import Event, Thread
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
from datetime import date, datetime, timezone
@@ -152,11 +150,11 @@ class NOAA3dayForecast(HTTPSolarConditionsProvider):
except (ValueError, IndexError):
continue
date = column_dates[i]
column_date = column_dates[i]
start_dt = datetime(
date.year,
date.month,
date.day,
column_date.year,
column_date.month,
column_date.day,
start_hour,
0,
0,
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
-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 logging
import re
import socket
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
from datetime import datetime
-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
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
from datetime import datetime
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
import socket
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from typing import Any, ClassVar
+2 -8
View File
@@ -1,17 +1,11 @@
from __future__ import annotations
from datetime import datetime
from typing import TYPE_CHECKING, Any
from typing import Any
import pytz
from core.data_store import DATA_STORE
from core.live_data_cache import LiveDataCache
if TYPE_CHECKING:
# Deferred to avoid a circular import: data.spot imports core.call_lookup_helper, which imports
# core.data_providers, which imports this module.
from data.spot import Spot
from data.spot import Spot
class SpotProvider:
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from threading import Event, Lock, Thread
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from typing import Any, ClassVar
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import json
from datetime import datetime
from typing import Any
-2
View File
@@ -1,5 +1,3 @@
from __future__ import annotations
import re
from datetime import datetime
from typing import Any
@@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from datetime import datetime
from threading import Event, Thread

Some files were not shown because too many files have changed in this diff Show More