61 lines
7.7 KiB
Markdown
61 lines
7.7 KiB
Markdown
# Modification
|
||
|
||
**Verdict**: changed
|
||
**Changed**: scripts/ranges.py
|
||
**data.py**: unchanged
|
||
|
||
## What the analyst used
|
||
- Tools: `inventory.py` (window), `overview.py` (`--table no`, `--table`, `--rigid --follow`: decisive, it showed that the reference moves and the targets do not), `metrics.py`, `summary.py` (1 h, `--mark`), `days.py --bounds --smoothing 5`, `ranges.py` (`--rolling`, `--k`), `thumbnails.py --fixed`, `ls | grep` on the images.
|
||
- Its own scripts: `native.py` (a table of a few sensors with several columns plus the pose, one row per measurement; run 4 times), `uncovered.py` (rolling-level deviations not covered by a label), then, for the requalification, `requalify.py` (per label: the largest deviation from the level of the 3 h before, in noises of the range), `night.py` (thermal labels against the 00–05 night level, the largest and the 3rd largest deviation), `smooth.py` (each measurement in noises and the largest 3-point running median).
|
||
- What it missed: in the requalification it had to tell a sustained deviation from a single point. FLORIDA-38 was removed because its only crossings were single measurements. No tool said how many measurements inside a label cross the threshold, so it wrote "3rd largest" and "running median" by hand. Its analysis lists no tool difficulty ("Difficulties": only the usage limit).
|
||
- What got in the way (found while trying things): in `ranges.py`, a sensor name of 9 characters or more runs into the next column (`Sellette 42026-10-12T00:45Z`), and so does a value like `-1.137e-13` or `+0.0008831` (`897-1.137e-13`, `1+0.0008831`). The tables can then not be read or split on spaces.
|
||
|
||
## Diagnosis
|
||
- The output of `ranges.py` could not be read with long names or long numbers. Cause: fixed column widths (sensor 9, numbers 10) with no separator.
|
||
- `requalify.py` is now covered by `ranges.py --labels F --margin 3h`, added today after this analysis: same deviations within 0.1 to 0.4 noise (for example FLORIDA-30 S5 x -5.0 against -4.9, FLORIDA-38 S4 x +8.9 against +8.7).
|
||
- `night.py` and `smooth.py` mostly duplicate `days.py --bounds --night 0-5 --smoothing 3 --sensors <one target>`. That gives the per-day deviation from the night level, names a reference night that is not the previous one (16/10 → night 15/10), and gives the number of measurements beyond k.
|
||
- Spike against sustained: the size lines of `ranges.py --labels` gave only the extreme. Cause: no count of crossings against the level before.
|
||
- `native.py` (several columns plus the pose per measurement): `summary.py --step 15min --level window --mark` gives one column per run, and `overview.py --table` gives the pose. That is three runs instead of one, and the analyst did not report it as a difficulty.
|
||
|
||
## What I decided
|
||
- `ranges.py` column widths: changed (S1). It was a readability bug, the contents stay the same.
|
||
- `ranges.py --labels`: changed (S2). Each size line now ends with a new column, `>k` (crossings/measurements inside). This replaces the analyst's "3rd largest" and running median with a single general count.
|
||
- `requalify.py`: left in the analysis. `ranges.py --labels --margin` already does what it does.
|
||
- `night.py`, `smooth.py`: left in the analysis. They duplicate `days.py --bounds`. A sentence of the guide pointing to it would help (see "Not fixed").
|
||
- `native.py`: left. It is three existing runs, and no difficulty was reported.
|
||
- `uncovered.py`: left. It is `ranges.py --rolling --instants 2 --labels` (labels covering each instant).
|
||
- Nothing removed.
|
||
|
||
## What changed
|
||
- S1, `0677c3c`, `scripts/ranges.py`: the sensor column width was fixed at 9. It is now `max(9, longest name + 1)` (new variable `w`). The `level`, `noise` and `jump` columns of the level table and the `extreme` column of the range table go from 10 to 11 characters, headers included. Nothing else changes: the output without spaces is the same as before.
|
||
- S2, `f57e6ea`, `scripts/ranges.py`: with `--labels`, each size line (sensor-column under a label) gets a new last column, `>k`. It says how many of the measurements inside the label are more than `--k` noises from the level before (median of `--margin` before the start), out of the measurements inside (`1/40`). It shows `-` when the label has no measurement inside. The column header and the docstring say it. The existing columns do not change.
|
||
|
||
## Why
|
||
- S1: the columns had fixed widths with no separator. A name or a value as wide as its column ran into the next one, and the table could neither be read nor split on whitespace.
|
||
- S2: an extreme above the threshold alone does not say whether one measurement crosses it or the whole label does. To requalify labels the analyst needs that difference and had to script it. The count against the level before answers it on any station.
|
||
|
||
## Checks
|
||
- `python3 tools/scripts/ranges.py data/FLORIDA/ --columns corr_x,corr_y --k 5 --start 2026-10-11T09:45Z --end 2026-10-22T03:15Z` → `work/ranges_k5.txt`. Exit 0. Without spaces it is the same as the analyst's `work/req/ranges_k5.txt`. `Pont Ernen 2026-10-11T10:00Z …` and `897 -1.137e-13` are now separated.
|
||
- `python3 tools/scripts/ranges.py data/FLORIDA/ --columns corr_x,corr_y --k 5 --rolling 4 --sensors "Sellette 4,Sellette 5,Massif 2,Sellette 6" --start … --end …` → `work/ranges_k5_roll4.txt`. Exit 0. Without spaces it is the same as the analyst's file. After S2 it is byte-identical to the S1 output.
|
||
- `python3 tools/scripts/ranges.py data/FLORIDA --columns corr_x,corr_y --k 5 --sensors "Sellette 4,Sellette 5,Massif 2,Sellette 6" --labels <analysis>/work/requalify_input.jsonl --margin 3h --start 2026-10-11T06:45Z --end 2026-10-22T06:15Z` → `work/tools/ranges_labels_S2.txt` (before: `work/ranges_labels_before.txt`). Exit 0. The values do not change. `>k` added, for example FLORIDA-38 `Sellette 4.corr_x +8.9 … 1/40` (a single point), FLORIDA-28 `Sellette 5.corr_x -6.9 … 17/44`, FLORIDA-30 `0/19`. Outage labels show `-`.
|
||
- `--instants 2 --labels …`: exit 0. `quality.py --self-test`: ok (after each fix).
|
||
- No PNG: `ranges.py` draws none.
|
||
- Report commands rerun: 2 (the two `ranges.py` commands of the requalification; the analysis's own scripts do not use a changed tool). No failure.
|
||
|
||
## For the user to decide
|
||
- `GUIDE.md` was given as already modified, so I left it uncommitted and untouched. Yet `tools/CLAUDE.md` wants an output change in the guide in the same change. The `>k` column is described in the script's docstring and in its own header, not in the guide. The sentence to add to the `--labels` item of `### ranges`, after "`after` (its measurements)": "; `>k`: how many measurements inside are more than `--k` noises from the level before, of those inside (one: a single point; many: sustained)".
|
||
|
||
## Not fixed
|
||
- Guide sentence (needs `GUIDE.md`, locked in this session). Under `--labels` of `### ranges`: "A label of a daily cycle (thermal): its level before is the morning; against the night level of its day, `days.py --bounds --night 0-5 --smoothing 3 --sensors <one target>` (one run per target; a night in an outage is replaced by the next one, named)". That would have saved `night.py` and `smooth.py`.
|
||
- The head line of each label (`{sensor}.{abbrev}` in 14 characters) and the `sensor.column` of 22 characters can still run into the next column with very long names. They are right-aligned numbers after them, so they stay readable on the stations seen.
|
||
|
||
## Limits
|
||
none
|
||
|
||
## Tools
|
||
none (the trials are tool runs; their outputs are in `work/` and `work/tools/`)
|
||
|
||
## Difficulties
|
||
- `GUIDE.md` is "already modified, neither committed nor reverted", but the target's rules want each output or option change in the guide in the same commit. I committed `scripts/ranges.py` only and wrote the guide sentences here.
|
||
- The output folder already held another upgrader's files (detectors: `modification.md`, `validation.md`, `tools/`). I wrote only `tools.md` and `work/`.
|