points: a dataset may be of a run of the emulator, <SERIAL>@<run>, its own measurements

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-20 08:31:18 +01:00
1 parent 16582782b2
commit 71e5aa25ca
1 file changed
+4 -2
+4 -2
View File
@@ -4,7 +4,7 @@ aimsight-app (page Points). No family, no cause: the ground truth of the benchma
python3 labeling/scripts/points.py # checks every dataset of points/ python3 labeling/scripts/points.py # checks every dataset of points/
python3 labeling/scripts/points.py --test # the self-check of this file python3 labeling/scripts/points.py --test # the self-check of this file
A dataset: `points/<STATION>_<start>_<end>.csv` (days, UTC, end excluded), one line per measurement of the range, A dataset: `points/<STATION>_<start>_<end>.csv` (`<STATION>` a station of data/ or a run, `<SERIAL>@<run>`) (days, UTC, end excluded), one line per measurement of the range,
`sensor_name,time_utc,valid` (`time_utc` `YYYY-MM-DDTHH:MM:SSZ`, `valid` 1 or 0), sorted by sensor then time. Created `sensor_name,time_utc,valid` (`time_utc` `YYYY-MM-DDTHH:MM:SSZ`, `valid` 1 or 0), sorted by sensor then time. Created
with every point valid; the measurements are those the station delivered with a position (rejected ones, without with every point valid; the measurements are those the station delivered with a position (rejected ones, without
`corr_x`, `corr_y`, are not points). Standard library. `corr_x`, `corr_y`, are not points). Standard library.
@@ -17,7 +17,8 @@ from datetime import datetime, timezone
FOLDER = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "points") FOLDER = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "points")
HEADER = ["sensor_name", "time_utc", "valid"] HEADER = ["sensor_name", "time_utc", "valid"]
NAME = re.compile(r"^([A-Za-z0-9_-]+)_(\d{4}-\d{2}-\d{2})_(\d{4}-\d{2}-\d{2})$") # a station of data/, or a run of the emulator <SERIAL>@<run> (data_diff/<SERIAL>/runs/<run>/: its own measurements)
NAME = re.compile(r"^([A-Za-z0-9_-]+(?:@[A-Za-z0-9_-]+)?)_(\d{4}-\d{2}-\d{2})_(\d{4}-\d{2}-\d{2})$")
TIME = "%Y-%m-%dT%H:%M:%SZ" TIME = "%Y-%m-%dT%H:%M:%SZ"
@@ -130,6 +131,7 @@ def test():
n = name("X1", "2026-01-01", "2026-01-02") n = name("X1", "2026-01-01", "2026-01-02")
a, b = datetime(2026, 1, 1, 0, 10, tzinfo=timezone.utc), datetime(2026, 1, 1, 0, 20, tzinfo=timezone.utc) a, b = datetime(2026, 1, 1, 0, 10, tzinfo=timezone.utc), datetime(2026, 1, 1, 0, 20, tzinfo=timezone.utc)
create(n, {"T2": [a], "T1": [b, a]}) create(n, {"T2": [a], "T1": [b, a]})
assert parts(name("X1@run01", "2026-01-01", "2026-01-02"))[0] == "X1@run01"
assert all(read(n).values()) and len(read(n)) == 3 and datasets() == [n] == datasets("X1") and datasets("X") == [] assert all(read(n).values()) and len(read(n)) == 3 and datasets() == [n] == datasets("X1") and datasets("X") == []
p = mark(n, "T1", [time(b)], False) p = mark(n, "T1", [time(b)], False)
assert p[("T1", time(b))] is False and p[("T1", time(a))] is True and read(n) == p and check(n) == [] assert p[("T1", time(b))] is False and p[("T1", time(a))] is True and read(n) == p and check(n) == []