Skip to content

Commit 24dba13

Browse files
committed
lint
1 parent 2478c6c commit 24dba13

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ repos:
1818
- --warn-return-any
1919
- --warn-unreachable
2020
- --warn-unused-ignores
21+
- --explicit-package-bases
2122
- repo: https://github.com/astral-sh/ruff-pre-commit
2223
rev: v0.2.2
2324
hooks:

__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

laika/astro_dog.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
from collections import defaultdict
33
from concurrent.futures import ThreadPoolExecutor
4-
from typing import DefaultDict
4+
from typing import DefaultDict, Sequence, Mapping
55
from collections.abc import Iterable
66

77
from .constants import SECS_IN_DAY
@@ -63,11 +63,11 @@ def __init__(self, auto_update=True,
6363
self.dcbs_fetched_times = TimeRangeHolder()
6464

6565
self.dgps_delays = []
66-
self.ionex_maps: list[IonexMap] = []
67-
self.orbits: DefaultDict[str, list[PolyEphemeris]] = defaultdict(list)
68-
self.qcom_polys: DefaultDict[str, list[PolyEphemeris]] = defaultdict(list)
69-
self.navs: DefaultDict[str, list[GPSEphemeris | GLONASSEphemeris]] = defaultdict(list)
70-
self.dcbs: DefaultDict[str, list[DCB]] = defaultdict(list)
66+
self.ionex_maps: Sequence[IonexMap] = []
67+
self.orbits: DefaultDict[str, Sequence[PolyEphemeris]] = defaultdict(list)
68+
self.qcom_polys: DefaultDict[str, Sequence[PolyEphemeris]] = defaultdict(list)
69+
self.navs: DefaultDict[str, Sequence[GPSEphemeris | GLONASSEphemeris]] = defaultdict(list)
70+
self.dcbs: DefaultDict[str, Sequence[DCB]] = defaultdict(list)
7171

7272
self.cached_ionex: IonexMap | None = None
7373
self.cached_dgps = None
@@ -160,16 +160,16 @@ def get_dgps_corrections(self, time, recv_pos):
160160
self.cached_dgps = latest_data
161161
return latest_data
162162

163-
def add_qcom_polys(self, new_ephems: dict[str, list[Ephemeris]]):
163+
def add_qcom_polys(self, new_ephems: Mapping[str, Sequence[Ephemeris]]):
164164
self._add_ephems(new_ephems, self.qcom_polys)
165165

166-
def add_orbits(self, new_ephems: dict[str, list[Ephemeris]]):
166+
def add_orbits(self, new_ephems: Mapping[str, Sequence[Ephemeris]]):
167167
self._add_ephems(new_ephems, self.orbits)
168168

169-
def add_navs(self, new_ephems: dict[str, list[Ephemeris]]):
169+
def add_navs(self, new_ephems: Mapping[str, Sequence[Ephemeris]]):
170170
self._add_ephems(new_ephems, self.navs)
171171

172-
def _add_ephems(self, new_ephems: dict[str, list[Ephemeris]], ephems_dict):
172+
def _add_ephems(self, new_ephems: Mapping[str, Sequence[Ephemeris]], ephems_dict):
173173
for k, v in new_ephems.items():
174174
if len(v) > 0:
175175
if self.clear_old_ephemeris:
@@ -208,7 +208,7 @@ def download_and_parse(constellation, parse_rinex_nav_func):
208208
end_day = GPSTime(time.week, SECS_IN_DAY * (1 + (time.tow // SECS_IN_DAY)))
209209
self.navs_fetched_times.add(begin_day, end_day)
210210

211-
def download_parse_orbit(self, gps_time: GPSTime, skip_before_epoch=None) -> dict[str, list[Ephemeris]]:
211+
def download_parse_orbit(self, gps_time: GPSTime, skip_before_epoch=None) -> Mapping[str, Sequence[PolyEphemeris]]:
212212
# Download multiple days to be able to polyfit at the start-end of the day
213213
time_steps = [gps_time - SECS_IN_DAY, gps_time, gps_time + SECS_IN_DAY]
214214
with ThreadPoolExecutor() as executor:

0 commit comments

Comments
 (0)