Scripts: shared helpers in common.py, no tool imports another; CLI and outputs unchanged

data.py stays the reader (METRIC_RE now also captures the file date, same matches);
common.py holds columns, steps, noise, sensor list, runs, file names. Duplicated
run grouping, pose gaps, step bucketing, --table/--outside parsing removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-16 15:48:42 +01:00
1 parent c1719cbd1d
commit 6ed4c420e1
13 files changed
+308 -359

No files matched your search

+2 -6
View File
@@ -32,18 +32,16 @@ import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt # noqa: E402
from common import check # noqa: E402
from data import find_files, image_time, iso, load, parse_time # noqa: E402
def percentile(grey, p):
"""Percentile p (0 to 100) of the pixels of a thumbnail, without interpolation."""
v = sorted(grey.ravel().tolist())
return v[min(int(p / 100 * len(v)), len(v) - 1)]
def main():
a = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
a.add_argument("folder")
@@ -62,9 +60,7 @@ def main():
zone = tuple(map(int, o.zone.split(","))) if o.zone else None
if not names and not zone:
sys.exit("Give --sensors, or --zone X,Y,W,H.")
missing = [s for s in names if s not in by]
if missing:
sys.exit(f"Unknown sensors: {', '.join(missing)}. Known: {', '.join(sorted(by))}.")
check("sensors", names, by)
known = sorted(h for h in images if h)
if not known:
sys.exit(f"No image in {o.folder}.")