Stations: pump the differential images into data_diff/ (pump_diff.sh through pumping.py, diff), beside the pumping of data/, each with its state and log

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-19 11:13:38 +01:00
1 parent cce6b850c6
commit 6b3f46434a
4 files changed
+28 -21

No files matched your search

+2
View File
@@ -79,6 +79,8 @@ def check_station():
assert all(e["message"] and e["action"] and set(e["targets"] + e["references"]) == set(e["sensors"]) for e in ev), ev[:1]
assert all(e["end"] >= "2026-10-26T00:00Z" and e["start"] < "2026-10-27T00:00Z" for e in ev), [(e["start"], e["end"]) for e in ev]
refuses(station.pump, {"stations": ["A;rm"]}) # the pumping (extraction/pumping.py, checked there): a refusal
refuses(station.pump, {"stations": ["A;rm"], "diff": True})
assert set(station.pump_state(True)) == {"running", "log"}
assert not any("SIM_CCID" in t or t.startswith("System: ip") for t in titles)
assert all(len(c["T"][tr["t"]]) == len(tr["y"]) for p in c["plots"] for tr in p["traces"])
if run := next((s for s in station.stations() if station.RUN in s), None): # a run of data_diff/, read as a station
+2 -2
View File
@@ -91,8 +91,8 @@ def save_tracked(body: dict):
@app.get("/api/pump")
def pump_state():
return station.pump_state()
def pump_state(diff: bool = False):
return station.pump_state(diff)
@app.post("/api/pump")
+9 -9
View File
@@ -236,7 +236,7 @@ def weather(hours):
# --- the tracked stations and the pumping: extraction/pumping.py of ~/aimsight-data
pump_process = None # the pumping launched by the app
pump_process = {} # the pumpings launched by the app, by diff (pump_diff.sh, into data_diff/: beside pump.sh)
def save_tracked(rows):
@@ -246,22 +246,22 @@ def save_tracked(rows):
raise Refusal(str(e))
def pump_state():
def pump_state(diff=False):
"""{running, log}; the end of the app's pumping empties the cache of the detectors' events."""
global pump_process
if pump_process and pump_process.poll() is not None:
pump_process = None
if (p := pump_process.get(diff)) and p.poll() is not None:
del pump_process[diff]
detectors.cache_clear()
return {"running": pumping.running() or pump_process is not None, "log": pumping.log()}
return {"running": pumping.running(diff) or diff in pump_process, "log": pumping.log(diff=diff)}
def pump(body):
global pump_process
diff = bool(body.get("diff"))
try:
pump_process = pumping.start(body.get("stations") or [], body.get("start") or "", body.get("end") or "", body.get("images"))
pump_process[diff] = pumping.start(body.get("stations") or [], body.get("start") or "", body.get("end") or "",
body.get("images"), diff)
except ValueError as e:
raise Refusal(str(e))
return pump_state()
return pump_state(diff)
# --- the Data page, "Detectors" labels: the events of the journal, read-only