From 80e00a48980ef54701cc034ec6aa4b880d7c4270 Mon Sep 17 00:00:00 2001 From: maxime Date: Fri, 13 Nov 2026 12:31:22 +0100 Subject: [PATCH] wf-improve tools in skills/wf-improve/scripts/ Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 4 ++-- README.md | 5 ++--- agents/upgrader.md | 6 +++--- agents/validator.md | 2 +- skills/wf-improve/SKILL.md | 16 ++++++++-------- .../wf-improve/scripts}/regression.py | 2 +- .../wf-improve/scripts}/score.py | 4 ++-- .../wf-improve/scripts}/sensors.py | 4 ++-- 8 files changed, 21 insertions(+), 22 deletions(-) rename {scripts/wf-improve => skills/wf-improve/scripts}/regression.py (96%) rename {scripts/wf-improve => skills/wf-improve/scripts}/score.py (96%) rename {scripts/wf-improve => skills/wf-improve/scripts}/sensors.py (89%) diff --git a/CLAUDE.md b/CLAUDE.md index a1a70a4..366b27c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ AIMsight anomaly detectors (Python 3, standard library only) and the Claude Code ## Contract (do not break) -- One detector per family of `labeling/familles.md` (D-119), in `scripts/`: `visibility.py`, `obstruction.py`, `target_issue.py`, `thermal_displacement.py`, `no_data.py`, `displacement.py`. `categories.py` loads every `scripts/*.py` that has `detect`: never put another script with a `detect` function, or one with side effects at import, directly in `scripts/` (tools go in `scripts/wf-improve/`). +- One detector per family of `labeling/familles.md` (D-119), in `scripts/`: `visibility.py`, `obstruction.py`, `target_issue.py`, `thermal_displacement.py`, `no_data.py`, `displacement.py`. `categories.py` loads every `scripts/*.py` that has `detect`: never put another script with a `detect` function, or one with side effects at import, directly in `scripts/` (tools go in `skills/wf-improve/scripts/`). - `detect(measurements)` returns episodes with the keys `start`, `end`, `kind` (the family), `label` (the variety), `text`, `ignore`, `sensors`. A detector may also declare `temperature`, `camera`, `metrics` (`categories.CONTEXT`) or `end`; `categories.events` passes them by introspection. - Diagnostic-app reads this repository as it is: `categories.events`, `categories.CATEGORIES` (`process`: `images`, `none`, `check`), the `--from/--to` CLIs, `/detectors:wf-improve`, `wf-improve//summary.md`. A rename here needs the matching change there. - Label fields come from Diagnostic-app and stay French: `debut`, `fin`, `categorie`, `description`; likewise `demande.json` (`STATION`, `début`, `fin`). @@ -13,5 +13,5 @@ AIMsight anomaly detectors (Python 3, standard library only) and the Claude Code - A constant added or changed updates `thresholds.md` in the same change; check with `grep -nE "^[A-Z_0-9]+ = " scripts/*.py`. - No rule specific to a station, a sensor or a date. -- A change to a detector is checked with the benchmark, from a working repository where this repository is mounted (or copied, not symlinked) as `detectors/` next to `data/` and `labeling/`: `python3 detectors/scripts/wf-improve/regression.py`. A refactoring must leave every figure unchanged. +- A change to a detector is checked with the benchmark, from a working repository where this repository is mounted (or copied, not symlinked) as `detectors/` next to `data/` and `labeling/`: `python3 detectors/skills/wf-improve/scripts/regression.py`. A refactoring must leave every figure unchanged. - History references in docstrings ("wf-improve X, mod. 1, S2", "X, batch 01", D-xxx, E-xxx) point to past sessions and to decisions recorded in Diagnostic-app/Support-Agent; keep them when editing a rule. diff --git a/README.md b/README.md index 6da65ea..1a98e3a 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,13 @@ python3 scripts/categories.py --from YYYY-MM-DD --to YYYY-MM-DD The station folder: `displacement/`, `metrics/`, `camera/` (the format of `data//` in Diagnostic-app). - `scripts/`: the detectors (`visibility.py`, `obstruction.py`, `target_issue.py`, `thermal_displacement.py`, `no_data.py`, `displacement.py`), `categories.py`, `data.py`. -- `scripts/wf-improve/`: the wf-improve workflow's tools, run from the working repository: `regression.py` (the benchmark, all labels of `labeling/auto/`), `score.py` (the score of a range), `sensors.py` (the sensors of each event). - `thresholds.md`: the registry of the detectors' thresholds. ## The wf-improve workflow: a Claude Code plugin The repository is also a Claude Code plugin (`.claude-plugin/plugin.json`), to be mounted as `detectors/` in a working repository that has `labeling/` (the labels, `labeling/auto/.jsonl`; the analyses, `labeling/auto/analyses/`), `data/` and `agent-tools/`: Diagnostic-app, where it is a submodule. -- `skills/wf-improve/SKILL.md`: `/detectors:wf-improve `, the session that improves the detectors from an analysis of the Data page, without overfitting. +- `skills/wf-improve/`: `/detectors:wf-improve ` (`SKILL.md`), the session that improves the detectors from an analysis of the Data page, without overfitting; its tools in `scripts/`, run from the working repository: `regression.py` (the benchmark, all labels of `labeling/auto/`), `score.py` (the score of a range), `sensors.py` (the sensors of each event). - `agents/`: `upgrader` (diagnoses and fixes the detectors) and `validator` (LLM-as-judge: keeps, removes or cancels the fixes), called `detectors:`. - `wf-improve/`: the sessions, one folder `_/` each, written by the skill. @@ -24,7 +23,7 @@ From the working repository: ```bash claude --plugin-dir detectors # then /detectors:wf-improve -python3 detectors/scripts/wf-improve/regression.py # the benchmark +python3 detectors/skills/wf-improve/scripts/regression.py # the benchmark ``` The session commits the detectors here, on `main`, without pushing: push `detectors` so that everyone has the updated detectors. diff --git a/agents/upgrader.md b/agents/upgrader.md index 77a74a6..0b6e90a 100644 --- a/agents/upgrader.md +++ b/agents/upgrader.md @@ -7,7 +7,7 @@ model: inherit You are the upgrader of the wf-improve workflow: your job is to make the detectors better from an analysis of the Data page (D-148). The user chose a range where the detectors satisfy them poorly; the analyst analysed it (`rapport.md`) and labelled it, and the labels of `labeling/auto/.jsonl` touching the range are the truth of the session (D-112, D-118). You compare what the detectors find with these labels, event by event, all families, say what is wrong and which detector causes it, then fix it. Afterwards, the `validator` judges your modification on all stations and all families of `labeling/auto/`: a gain on the range at the cost of another station or another family is refused. -You run in the working repository (Diagnostic-app: `labeling/`, `data/`, `agent-tools/`), where the **detectors** repository is mounted as `detectors/`: the detectors (`detectors/scripts/*.py`), `detectors/thresholds.md`, the session tools (`detectors/scripts/wf-improve/`) and the sessions (`detectors/wf-improve/`). What touches the detectors is committed in `detectors/` (`git -C detectors …`, paths relative to `detectors/`). +You run in the working repository (Diagnostic-app: `labeling/`, `data/`, `agent-tools/`), where the **detectors** repository is mounted as `detectors/`: the detectors (`detectors/scripts/*.py`), `detectors/thresholds.md`, the session tools (`detectors/skills/wf-improve/scripts/`) and the sessions (`detectors/wf-improve/`). What touches the detectors is committed in `detectors/` (`git -C detectors …`, paths relative to `detectors/`). **Avoid overfitting** (the user, D-148): a small step. A single range must not dictate the detectors: do better here with rules that would hold on any station, without aiming to reproduce exactly these labels. A constant tuned to make these bounds fall exactly, a rule that only recognises the exact shape of these events: no. What counts is the mechanism the analyst established (a rejected reference that makes all targets jump, for example), recognisable wherever it happens. What the detectors cannot see with these measurements (a cause only the image reveals) is not a fix: say it in "Limits", for the user. @@ -33,7 +33,7 @@ If nothing important is to be fixed: verdict `nothing to change`, write your out ## 2. What you change -Only the detectors (`detectors/scripts/*.py`, not `scripts/wf-improve/`) and `detectors/thresholds.md`; never `detectors/skills/`, `detectors/agents/` or the working repository. On them, anything is possible: add, remove or change a constant, a rule or a whole detector. You commit only as "One fix, one commit" says, never a file your request says was already modified at the start of the session. +Only the detectors (`detectors/scripts/*.py`) and `detectors/thresholds.md`; never `detectors/skills/`, `detectors/agents/` or the working repository. On them, anything is possible: add, remove or change a constant, a rule or a whole detector. You commit only as "One fix, one commit" says, never a file your request says was already modified at the start of the session. **Everything is detected** (the user, D-068): what is shown or not to the client is not the detectors' business. A setting chosen not to show something to the client does not stop you: you may change it, saying so in "What changed". @@ -62,7 +62,7 @@ Then the **benchmark**, the `regression.py` command of your request, against the - **The range score**: what you make rise, without losing a whole event. A hole has no measurement: it only counts its two bounds in the score; for a hole, read the events command. Do not aim for 100 %. - **All lines of all stations**: the non-regression, the same rule as the validator. **A regression**, on a family of a station: "found" or "correct" loses more than 2 points; it is a regression even if the `Total` rises. **Not a regression** (D-135): a drop that comes from another consistent reading of the detectors that the labels do not retain (labels contradicting each other from one station to another, the gaps of a few measurements between two labels of the same phenomenon, the bounds of a label, an instant the score counted as found by an event on another sensor). A regression: rework your change before committing it, or drop the fix. A drop from another consistent reading: keep it, and say it in "For the user to decide". -Your working folder is yours alone: `mktemp -d`, or a subfolder named after you in the session's temporary folder. To try a variant without touching the repository, copy `detectors/` there, with links to `data/`, `labeling/` and `agent-tools/`: the copy's `detectors/scripts/wf-improve/regression.py` measures the copy. For a shorter run, `--stations A,B` measures only these stations; the whole benchmark (about 3 min) runs in the background, output to a file. +Your working folder is yours alone: `mktemp -d`, or a subfolder named after you in the session's temporary folder. To try a variant without touching the repository, copy `detectors/` there, with links to `data/`, `labeling/` and `agent-tools/`: the copy's `detectors/skills/wf-improve/scripts/regression.py` measures the copy. For a shorter run, `--stations A,B` measures only these stations; the whole benchmark (about 3 min) runs in the background, output to a file. ## 4. One fix, one commit diff --git a/agents/validator.md b/agents/validator.md index f7aa0fa..6d6f71f 100644 --- a/agents/validator.md +++ b/agents/validator.md @@ -7,7 +7,7 @@ model: inherit You are the validator of the wf-improve workflow, its safeguard. The upgrader has just adapted the detectors to better find the events of the range of an analysis of the Data page (D-148), a single range of a single station. The risk is overfitting: detectors glued to this range, which lose precision elsewhere, on another station or another family. You check it, and you decide in the end, in a single pass: keep the modification, have part of it removed, or cancel it. -You run in the working repository (Diagnostic-app: `labeling/`, `data/`, `agent-tools/`), where the **detectors** repository is mounted as `detectors/`: the detectors (`detectors/scripts/*.py`), `detectors/thresholds.md`, the session tools (`detectors/scripts/wf-improve/`) and the sessions (`detectors/wf-improve/`). +You run in the working repository (Diagnostic-app: `labeling/`, `data/`, `agent-tools/`), where the **detectors** repository is mounted as `detectors/`: the detectors (`detectors/scripts/*.py`), `detectors/thresholds.md`, the session tools (`detectors/skills/wf-improve/scripts/`) and the sessions (`detectors/wf-improve/`). **You stay independent**: you do not read the upgrader's diagnosis. Your conclusions come from the benchmark of `regression.py` on the labels of `labeling/auto/`, the only truth (D-118), and from the code of the detectors. diff --git a/skills/wf-improve/SKILL.md b/skills/wf-improve/SKILL.md index a3e698f..fd4d853 100644 --- a/skills/wf-improve/SKILL.md +++ b/skills/wf-improve/SKILL.md @@ -6,7 +6,7 @@ argument-hint: "" # wf-improve: the detectors from an analysis -You are the orchestrator. You run in the **working repository** (Diagnostic-app, the current folder): `labeling/` (the labels, the truth; the analyses), `data/` (the stations' data), `agent-tools/`. The **detectors** repository is mounted there as `detectors/` (a submodule): the detectors (`detectors/scripts/`), their threshold registry `detectors/thresholds.md`, the session tools (`detectors/scripts/wf-improve/`) and the sessions (`detectors/wf-improve/`). Two git repositories, then: what touches the detectors is committed in `detectors/` (`git -C detectors …`), the analysis in the working repository. +You are the orchestrator. You run in the **working repository** (Diagnostic-app, the current folder): `labeling/` (the labels, the truth; the analyses), `data/` (the stations' data), `agent-tools/`. The **detectors** repository is mounted there as `detectors/` (a submodule): the detectors (`detectors/scripts/`), their threshold registry `detectors/thresholds.md`, the session tools (`detectors/skills/wf-improve/scripts/`) and the sessions (`detectors/wf-improve/`). Two git repositories, then: what touches the detectors is committed in `detectors/` (`git -C detectors …`), the analysis in the working repository. The user chose a range where the detectors satisfy them poorly; the analyst analysed it in the Data page: a report (`rapport.md`) and labels, added to `labeling/auto/.jsonl`. The user reviewed it, and starting this session is their agreement: there is no other validation. The goal: detectors **closer to the analysis's labels on its range**, by a small step, **without overfitting**: they do a little better there, and the benchmark on all stations and families of `labeling/auto/` stays good. You call the agents in order, pass on their outputs and commit. **You judge nothing yourself**: you only read the verdict lines. **You ask the user no question**: the session runs alone to the end. @@ -17,13 +17,13 @@ The user chose a range where the detectors satisfy them poorly; the analyst anal - `SESSION` = `date -u +%Y-%m-%dT%H%MZ`; session folder `detectors/wf-improve/_/`, below ``. - **Commits**: in both repositories, the branch must be `main` (`git branch --show-current` and `git -C detectors branch --show-current`), otherwise say so and stop; a detached submodule (no branch): `git -C detectors checkout main` first, if it has no change. You always commit by path (`git add && git commit -m "" -- `, or with `git -C detectors`, paths relative to `detectors/`), never `git add -A`, `git stash` or `git checkout` outside your paths: another session may be working in these repositories. Before each commit, the branch; if it is no longer `main`, commit nothing more and go to the summary. Each message ends with an empty line then `Co-Authored-By: Claude Opus 5.5 `. You push nothing. - **Step 0, the analysis in git**: the app does not commit; if `git status --porcelain -- labeling/auto/.jsonl` shows something, commit these two paths in the working repository (`git add` respects `.gitignore`: `travail/` stays out), message `wf-improve : labels of the analysis`. Then note the **session base**: `git -C detectors rev-parse HEAD`. -- `git -C detectors status --porcelain` and `git status --porcelain -- labeling/auto/ labeling/familles.md` (`familles.md`: the families, one per detector, that the benchmark counts): files already modified stay as they are, neither committed nor reverted; list them under "Errors" of the summary (the measures run on them). Take this reading again before the validator and before the summary, with the re-pumped data (`find -L data/ -name '*.csv' -newer /benchmark-before.txt | cut -d/ -f2 | sort -u`): a file changed during the session by another session (a label touched up in the Data page, for example) goes under "Errors"; before the validator, then rerun the benchmark before at the session base (in a `mktemp -d` folder: `git -C detectors archive --prefix=detectors/ | tar -x -C `, links to `data/`, `labeling/` and `agent-tools/` of the working repository, then `python3 /detectors/scripts/wf-improve/regression.py`) into `/benchmark-before-rerun.txt`, and add to the validator's request: `Changed during the session: ; benchmark before rerun: /benchmark-before-rerun.txt.` +- `git -C detectors status --porcelain` and `git status --porcelain -- labeling/auto/ labeling/familles.md` (`familles.md`: the families, one per detector, that the benchmark counts): files already modified stay as they are, neither committed nor reverted; list them under "Errors" of the summary (the measures run on them). Take this reading again before the validator and before the summary, with the re-pumped data (`find -L data/ -name '*.csv' -newer /benchmark-before.txt | cut -d/ -f2 | sort -u`): a file changed during the session by another session (a label touched up in the Data page, for example) goes under "Errors"; before the validator, then rerun the benchmark before at the session base (in a `mktemp -d` folder: `git -C detectors archive --prefix=detectors/ | tar -x -C `, links to `data/`, `labeling/` and `agent-tools/` of the working repository, then `python3 /detectors/skills/wf-improve/scripts/regression.py`) into `/benchmark-before-rerun.txt`, and add to the validator's request: `Changed during the session: ; benchmark before rerun: /benchmark-before-rerun.txt.` **The two measures** of the session, at each step: -- **the benchmark**, the non-regression: `python3 detectors/scripts/wf-improve/regression.py > /benchmark-.txt 2>&1` (about 3 min). The score per family and per instant on each station of `labeling/auto/`, then their `Total`; -- **the range score**, the goal: `python3 detectors/scripts/wf-improve/score.py data/ --from --to > /range-.txt 2>&1`. The labels of `labeling/auto/.jsonl` touching the range (the analysis's included), the truth of the session, against the detectors, per family. It exits with an error if no label touches the range: note it under "Errors" and go to the summary without touching the detectors. +- **the benchmark**, the non-regression: `python3 detectors/skills/wf-improve/scripts/regression.py > /benchmark-.txt 2>&1` (about 3 min). The score per family and per instant on each station of `labeling/auto/`, then their `Total`; +- **the range score**, the goal: `python3 detectors/skills/wf-improve/scripts/score.py data/ --from --to > /range-.txt 2>&1`. The labels of `labeling/auto/.jsonl` touching the range (the analysis's included), the truth of the session, against the detectors, per family. It exits with an error if no label touches the range: note it under "Errors" and go to the summary without touching the detectors. -**Commands**, given as they are to the agents: the events, `python3 detectors/scripts/categories.py data/ --from --to `; the sensors, `python3 detectors/scripts/wf-improve/sensors.py data/ --from --to `. For the validator only, which looks at all stations, the events command with ``, `` and `` to fill from the header of the station's block in the benchmark: `python3 detectors/scripts/categories.py data/ --from --to `. +**Commands**, given as they are to the agents: the events, `python3 detectors/scripts/categories.py data/ --from --to `; the sensors, `python3 detectors/skills/wf-improve/scripts/sensors.py data/ --from --to `. For the validator only, which looks at all stations, the events command with ``, `` and `` to fill from the header of the station's block in the benchmark: `python3 detectors/scripts/categories.py data/ --from --to `. ## 2. In order @@ -34,16 +34,16 @@ Session commits (the session folder, the detectors, `thresholds.md`) are made in 1. **Measures before**: step `before`, so `/benchmark-before.txt` and `/range-before.txt`. Commit `wf-improve/_/`, message `wf-improve : benchmark`. 2. **Upgrader**, a single pass: - `Analysis: /. Station: , range → (UTC). Events command: . Sensors command: . Range score: python3 detectors/scripts/wf-improve/score.py data/ --from --to (before: /range-before.txt). Benchmark before: /benchmark-before.txt, to rerun with python3 detectors/scripts/wf-improve/regression.py. Session folder: . Files already modified at the start of the session: . Write /modification.md.` + `Analysis: /. Station: , range → (UTC). Events command: . Sensors command: . Range score: python3 detectors/skills/wf-improve/scripts/score.py data/ --from --to (before: /range-before.txt). Benchmark before: /benchmark-before.txt, to rerun with python3 detectors/skills/wf-improve/scripts/regression.py. Session folder: . Files already modified at the start of the session: . Write /modification.md.` The upgrader commits each fix it keeps itself, in `detectors/`, with its benchmark `/benchmark-S.txt`, message `wf-improve : S`: the validator can thus have a single one removed. Then the measures, step `after`, in `/benchmark-after.txt` and `/range-after.txt`. Commit of the session folder, message `wf-improve : modification ()`. No fix kept (verdict `nothing to change`, or no `, S` commit: `git -C detectors log --format=%h --grep ': S[0-9]*$' ..HEAD`): go to the summary. 3. **Validator**, which reads neither the diagnosis nor the detail of the modification: - `Analysis: . Modification: /modification.md. Benchmark: /benchmark-before.txt → /benchmark-after.txt, to rerun with python3 detectors/scripts/wf-improve/regression.py; after each fix: /benchmark-S*.txt. Range score: /range-before.txt → /range-after.txt. Events command: . Base (in detectors/): . Write /validation.md.` + `Analysis: . Modification: /modification.md. Benchmark: /benchmark-before.txt → /benchmark-after.txt, to rerun with python3 detectors/skills/wf-improve/scripts/regression.py; after each fix: /benchmark-S*.txt. Range score: /range-before.txt → /range-after.txt. Events command: . Base (in detectors/): . Write /validation.md.` Commit of the session folder, message `wf-improve : validator ()`. - `keep`: go to the summary. - `remove`: for each fix of the `**Remove**:` line, its session commits (`git -C detectors log --format=%h --grep ': S$' ..HEAD`), from the most recent to the oldest: `git -C detectors revert --no-edit `, then amend its message so that it ends with the `Co-Authored-By` line (`git -C detectors commit --amend -m "wf-improve : S removed" -m "Co-Authored-By: Claude Opus 5.5 "`). A conflict: `git -C detectors revert --abort`, and do as for `cancel`. Then go to the summary. - - `cancel`, or any other word: `git -C detectors checkout -- 'scripts/*.py' thresholds.md` (without the files already modified noted in §1; `scripts/wf-improve/` is not touched), commit of these paths, message `wf-improve : modification cancelled`. + - `cancel`, or any other word: `git -C detectors checkout -- 'scripts/*.py' thresholds.md` (without the files already modified noted in §1; `skills/wf-improve/` is not touched), commit of these paths, message `wf-improve : modification cancelled`. An output missing or without a readable verdict: note it, put the detectors back as for `cancel` if they changed, go to the summary. Do not rerun an agent more than once. diff --git a/scripts/wf-improve/regression.py b/skills/wf-improve/scripts/regression.py similarity index 96% rename from scripts/wf-improve/regression.py rename to skills/wf-improve/scripts/regression.py index f99d653..6a6c343 100644 --- a/scripts/wf-improve/regression.py +++ b/skills/wf-improve/scripts/regression.py @@ -5,7 +5,7 @@ For each station of labeling/auto/ that has its folder in data/, the score per f by family, which says whether the detectors do better overall from one session to the next. The block of the session's station is its score; the other blocks, the non-regression: a family that goes back on a station is a regression, even if the total rises. -Usage: python3 detectors/scripts/wf-improve/regression.py [--stations A,B] +Usage: python3 detectors/skills/wf-improve/scripts/regression.py [--stations A,B] """ import argparse import json diff --git a/scripts/wf-improve/score.py b/skills/wf-improve/scripts/score.py similarity index 96% rename from scripts/wf-improve/score.py rename to skills/wf-improve/scripts/score.py index 3319e20..30952bb 100644 --- a/scripts/wf-improve/score.py +++ b/skills/wf-improve/scripts/score.py @@ -8,7 +8,7 @@ range classified with its 3 days of history). The category of an event is its fa The score is a fact, not a verdict: the labels can be wrong too. No label on the range: exits with an error. Label fields (written by Diagnostic-app): debut, fin, categorie (the family), description. Run from the working repository, where detectors/ is mounted. -Usage: python3 detectors/scripts/wf-improve/score.py --from YYYY-MM-DD --to YYYY-MM-DD +Usage: python3 detectors/skills/wf-improve/scripts/score.py --from YYYY-MM-DD --to YYYY-MM-DD """ import argparse import json @@ -17,7 +17,7 @@ import sys from datetime import timedelta from pathlib import Path -REPO = Path(os.path.abspath(__file__)).parents[2] # the detectors repository +REPO = Path(os.path.abspath(__file__)).parents[3] # the detectors repository WORK = REPO.parent # the working repository (labeling/, data/) sys.path.insert(0, str(REPO / "scripts")) import categories # noqa: E402 diff --git a/scripts/wf-improve/sensors.py b/skills/wf-improve/scripts/sensors.py similarity index 89% rename from scripts/wf-improve/sensors.py rename to skills/wf-improve/scripts/sensors.py index a96c3fb..ca0e28d 100644 --- a/scripts/wf-improve/sensors.py +++ b/skills/wf-improve/scripts/sensors.py @@ -1,7 +1,7 @@ """For the upgrader: the cadence of the measurements of the range, the number of targets and references, then each event of the range with its sensors (categories.py only gives their number). Same computation as categories.py without --chunk (3 days of history). -Usage: python3 detectors/scripts/wf-improve/sensors.py --from YYYY-MM-DD --to YYYY-MM-DD +Usage: python3 detectors/skills/wf-improve/scripts/sensors.py --from YYYY-MM-DD --to YYYY-MM-DD """ import argparse import statistics @@ -9,7 +9,7 @@ import sys from datetime import datetime, timedelta, timezone from pathlib import Path -sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +sys.path.insert(0, str(Path(__file__).resolve().parents[3] / "scripts")) import categories # noqa: E402 from data import iso, load # noqa: E402