diff --git a/crates/rs1090/readme.md b/crates/rs1090/readme.md index 886e9f6..b6b4f49 100644 --- a/crates/rs1090/readme.md +++ b/crates/rs1090/readme.md @@ -15,7 +15,7 @@ The directions ambitioned by rs1090 boil down to: If you just want to decode ADS-B messages from your Raspberry and visualize the data on a map, you may want to stick to one of the dump0190 implementations. -The rs1090 library comes with a companion application [decode1090](https://crates.io/crates/decode1090) and a Python binding [rs1090](https://pypi.org/project/rs1090). +The rs1090 library comes with a companion application [decode1090](https://crates.io/crates/decode1090), a live decoder [jet1090](https://crates.io/crates/jet1090), and a Python binding [rs1090](https://pypi.org/project/rs1090). ## Performance @@ -31,7 +31,7 @@ The Python script for benchmarking is in [python/examples](python/examples/bench The Rust benchmark is executed with `cargo bench`. Both scripts are run on an Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz. -![](./python/examples/benchmark.svg) +![Benchmark image](./python/examples/benchmark.svg) > [!NOTE] > The default out-of-the-box mode of `rs1090` is an execution distributed on all your cores. This benchmark was performed on a regular laptop. It can be much faster on supercomputers, but considering that most laptops now have at least 4 cores, this benchmark yields the speed-up you should get on your own computer. diff --git a/python/examples/bench_pms.py b/python/examples/bench_pms.py index 8e77e55..9b120fb 100644 --- a/python/examples/bench_pms.py +++ b/python/examples/bench_pms.py @@ -1,6 +1,6 @@ from typing import Any -from pyModeS import adsb, bds, commb, py_common +from pyModeS import adsb, bds, commb, py_common # type: ignore def decode(msg: str, common: Any = py_common) -> dict[str, Any]: diff --git a/python/examples/flarm.py b/python/examples/flarm.py index 5ce216d..ed62bde 100644 --- a/python/examples/flarm.py +++ b/python/examples/flarm.py @@ -66,7 +66,7 @@ # %% -import matplotlib.pyplot as plt +import matplotlib.pyplot as plt # type: ignore from cartes.crs import Lambert93, PlateCarree # type: ignore from cartes.osm import Overpass # type: ignore @@ -86,7 +86,7 @@ ) ax.spines["geo"].set_visible(False) ax.yaxis.set_visible(False) -ax.set_extent((5.1, 5.16, 43.59, 43.64)) +ax.set_extent((5.1, 5.16, 43.59, 43.64)) # type: ignore fig.savefig("flarm.png") # %% diff --git a/python/rs1090/__init__.py b/python/rs1090/__init__.py index 2d6c0dd..7c84582 100644 --- a/python/rs1090/__init__.py +++ b/python/rs1090/__init__.py @@ -130,11 +130,11 @@ def decode( if timestamp is not None and len(timestamp) != len(msg): raise ValueError("`msg` and `timestamp` must be of the same length") - batches = list(batched(msg, batch)) + batches = list(batched(msg, batch)) # type: ignore if timestamp is None: payload = decode_1090_vec(batches) else: - ts = list(batched(timestamp, batch)) + ts = list(batched(timestamp, batch)) # type: ignore payload = decode_1090t_vec(batches, ts, reference) return pickle.loads(bytes(payload)) # type: ignore @@ -153,20 +153,20 @@ def flarm( @overload def flarm( - msg: Sequence[str], - timestamp: Sequence[int], - reference_latitude: Sequence[float], - reference_longitude: Sequence[float], + msg: Sequence[str] | pd.Series, + timestamp: Sequence[int] | pd.Series, + reference_latitude: Sequence[float] | pd.Series, + reference_longitude: Sequence[float] | pd.Series, *, batch: int = 1000, ) -> list[Flarm]: ... def flarm( - msg: str | Sequence[str], - timestamp: int | Sequence[int], - reference_latitude: float | Sequence[float], - reference_longitude: float | Sequence[float], + msg: str | Sequence[str] | pd.Series, + timestamp: int | Sequence[int] | pd.Series, + reference_latitude: float | Sequence[float] | pd.Series, + reference_longitude: float | Sequence[float] | pd.Series, *, batch: int = 1000, ) -> Flarm | list[Flarm]: @@ -176,19 +176,19 @@ def flarm( assert isinstance(reference_longitude, (int, float)) payload = decode_flarm( msg, - timestamp, + timestamp, # type: ignore reference_latitude, reference_longitude, ) else: - batches = list(batched(msg, batch)) + batches = list(batched(msg, batch)) # type: ignore assert not isinstance(timestamp, (int, float)) assert not isinstance(reference_latitude, (int, float)) assert not isinstance(reference_longitude, (int, float)) - t = list(batched(timestamp, batch)) - reflat = list(batched(reference_latitude, batch)) - reflon = list(batched(reference_longitude, batch)) + t = list(batched(timestamp, batch)) # type: ignore + reflat = list(batched(reference_latitude, batch)) # type: ignore + reflon = list(batched(reference_longitude, batch)) # type: ignore payload = decode_flarm_vec(batches, t, reflat, reflon)