Skip to content

Python tool for aircraft Doppler audio geolocation using historical ADS-B flight data (Source-available)

test: preserve legacy arithmetic across complete-batch cache reuse (#7)

Cinna Davis29a957a1df20
diff --git a/docs/PRODUCT.md b/docs/PRODUCT.md
index e6a1c0f..11a9c2c 100644
--- a/docs/PRODUCT.md
+++ b/docs/PRODUCT.md
@@ -30,6 +30,12 @@ processed stage or tile is repeated. Input, detector and checkpoint integrity
are checked before reuse; incompatible search checkpoints fail explicitly.
Stopping before discovery completes cannot resume from that stage.
+Saved searches from the November 3 `225bf6b` scorer have a compatible upgrade
+path to the faster staged scorer. Resume retains their completed scores and
+tile files, archives the previous search and identities, and processes only
+unfinished work. Input, event, runtime and model checks still reject unsupported
+transitions; the upgrade does not make an inconclusive result conclusive.
+
The server binds to loopback. It runs one analysis process at a time, accepts up
to four pending jobs, limits uploads to 100 MiB by default, and limits analysis
to one hour by default. Set `--max-upload-mb` and `--max-runtime` to change these
diff --git a/tests/test_real_legacy_batch_cache.py b/tests/test_real_legacy_batch_cache.py
new file mode 100644
index 0000000..fed13d7
--- /dev/null
+++ b/tests/test_real_legacy_batch_cache.py
@@ -0,0 +1,28 @@
+"""Keep saved first-group arithmetic separate in the recorded batch cache."""
+import json
+from pathlib import Path
+
+import numpy as np
+
+from dopplergeist import batch_ridge, matching
+
+
+def test_recorded_legacy_and_current_batches_do_not_share_cache_entries():
+ fixture = json.loads((Path(__file__).parent / "data/real-ridge-batch-arithmetic.json").read_text())
+ measurement = (matching.RidgeTimes(np.asarray(fixture["times"])),
+ np.asarray(fixture["ridge"]), np.asarray(fixture["weight"]), {})
+ event = fixture["event"]
+ factors, emissions = np.asarray(fixture["factors"]), np.asarray(fixture["emissions"])
+ canonical = batch_ridge._first_event_fits_uncached(measurement, event, factors, emissions)
+ legacy = batch_ridge._first_event_fits_uncached(measurement, event, factors, emissions,
+ legacy_arithmetic=True)
+
+ @matching._cache_ridge_fits
+ def check():
+ for _ in range(2):
+ assert batch_ridge.first_event_fits(measurement, event, factors, emissions) == canonical
+ assert batch_ridge.first_event_fits(measurement, event, factors, emissions,
+ legacy_arithmetic=True) == legacy
+ assert len(matching._ridge_fit_cache.get().batch_fit_entries) == int(canonical is not None) + int(legacy is not None)
+
+ check()