Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoder Type #222

Merged
merged 6 commits into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions traffic/data/adsb/decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ class AircraftDict(Dict[str, Aircraft]):

lat0: float
lon0: float
decoder: ModeS_Decoder
decoder: Decoder

def __missing__(self, key: str) -> Aircraft:
self.decoder.on_new_aircraft(key)
Expand Down Expand Up @@ -1073,7 +1073,7 @@ def from_file(
crc_check: bool = False,
template: str = "time, longmsg",
sep: str = ",",
) -> "ModeS_Decoder":
) -> Decoder:
"""Decode raw messages dumped in a text file.

The file should contain for each line at least a timestamp and an
Expand Down Expand Up @@ -1138,7 +1138,7 @@ def from_binary(
time_0: Optional[datetime] = None,
redefine_mag: int = 10,
fh: Optional[TextIO] = None,
) -> "ModeS_Decoder":
) -> Decoder:

decoder = cls(reference)
redefine_freq = 2**redefine_mag - 1
Expand Down Expand Up @@ -1187,7 +1187,7 @@ def from_rtlsdr(
reference: Union[str, Airport, tuple[float, float]],
file_pattern: str = "~/ADSB_EHS_RAW_%Y%m%d_rtlsdr.csv",
uncertainty: bool = False,
) -> "ModeS_Decoder": # coverage: ignore
) -> Decoder: # coverage: ignore
"""Decode raw messages dumped from a RTL-SDR receiver.

:param reference: the reference location, as specified above
Expand Down Expand Up @@ -1236,7 +1236,7 @@ def from_socket(
time_0: Optional[datetime] = None,
redefine_mag: int = 7,
fh: Optional[TextIO] = None,
) -> "ModeS_Decoder": # coverage: ignore
) -> Decoder: # coverage: ignore

decoder = cls(reference)
redefine_freq = 2**redefine_mag - 1
Expand Down Expand Up @@ -1344,7 +1344,7 @@ def from_dump1090(
reference: Union[str, Airport, tuple[float, float]],
file_pattern: str = "~/ADSB_EHS_RAW_%Y%m%d_dump1090.csv",
uncertainty: bool = False,
) -> "ModeS_Decoder": # coverage: ignore
) -> Decoder: # coverage: ignore
"""Decode raw messages dumped from `dump1090
<https://github.com/MalcolmRobb/dump1090/>`_

Expand Down Expand Up @@ -1390,7 +1390,7 @@ def from_address(
time_fmt: str = "radarcape",
uncertainty: bool = False,
tcp: bool = True,
) -> "ModeS_Decoder": # coverage: ignore
) -> Decoder: # coverage: ignore
"""Decode raw messages transmitted over a TCP or UDP network.

The file should contain for each line at least a timestamp and an
Expand Down