Library only: remove tests, cluster verification, deploy tooling and submodules
Pipeline.map keeps its API. Development-cluster specifics removed: the DASK_SCHEDULER variable (DASK_SCHEDULER_ADDRESS stays), direct_to_workers=False, the shared-cluster priority rule (default priority 0) and the SeaweedFS S3 defaults. README: install as a submodule, batches.
This commit is contained in:
@@ -12,7 +12,7 @@ https://claude.ai/artifact/H9Rh19Lv79dVeikeVD9KFZ
|
||||
|---|---|---|
|
||||
| Code | the director's methods on MNE, SciPy, scikit-learn, antropy, fooof, meegkit | the director's code (biomarcadores-tea @ 7dfc641, codigo @ c7a4736) copied unchanged except imports |
|
||||
| Batches | Dask (`cluster="auto"/"remote"/"local"/"sync"`) | plain single-threaded loop |
|
||||
| Checked against | legacy, on synthetic EDFs | the submodule's own scripts, exactly |
|
||||
| Provenance | written against legacy (equal to float32 precision without acquisition gaps) | each file's header names its source file and commit |
|
||||
|
||||
## Modules
|
||||
|
||||
@@ -47,7 +47,7 @@ study = pipe.study("study.edf", plan=DIRECTOR_CLUSTER, age_months=27.5)
|
||||
pipe.biomarker("posterior_rhythm").measure(study)
|
||||
|
||||
table = pipe.map(paths, plan=DIRECTOR_CLUSTER, ages_months=ages,
|
||||
biomarkers=("posterior_rhythm", "spindles")) # Dask: cluster or LocalCluster
|
||||
biomarkers=("posterior_rhythm", "spindles")) # Dask: LocalCluster, or scheduler=
|
||||
rhythm = pipe.biomarker("posterior_rhythm").train(table) # baseline: curves or age_blocks
|
||||
rhythm.predict(table.iloc[[0]]) # outside -1/0/+1, z
|
||||
|
||||
@@ -58,22 +58,25 @@ Replace a module: `pipe.replace("spindle_detection", MyDetector())`, or register
|
||||
it under the same name in the `tea.modules` entry-point group. Check it
|
||||
with `tea.contracts.testing`.
|
||||
|
||||
## Tests and cluster verification
|
||||
## Install
|
||||
|
||||
- `uv run pytest` (synthetic EDFs only; no patient data).
|
||||
- Cluster checks live in `verification/`, outside the package (not in the
|
||||
wheel). `deploy/verify.sh` builds `tea-verify:<commit>` from this checkout and
|
||||
runs one in a `DaskJob` of its own:
|
||||
- `deploy/verify.sh` (`hk1k`): the test suite plus `python -m verification hk1k`
|
||||
(HK1K, public, `raw/eeg-helsinki/`);
|
||||
- `deploy/verify.sh issste`: `python -m verification issste` on
|
||||
`processed/eeg-edf-2025/` and `eeg-edf-2026/`, with every biomarker in both
|
||||
implementations.
|
||||
- `deploy/verify.sh --logs`, `--delete`.
|
||||
- `python tools/vendor_legacy.py --check` confirms the legacy copies are
|
||||
unchanged.
|
||||
Python ≥ 3.12. As a git submodule of another project:
|
||||
|
||||
The unit tests never read patient data. Both cluster checks write group
|
||||
summaries only, to `processed/usuarios/`. The ISSSTELEÓN check keeps file
|
||||
names, paths, birthdates and per-study rows inside the job (the 2026 file names
|
||||
carry the patient's surname), and suppresses groups under 5.
|
||||
```sh
|
||||
git submodule add ssh://git@10.0.10.41:2222/alberto/tea.git libs/tea
|
||||
uv add --editable ./libs/tea # or: pip install -e libs/tea
|
||||
```
|
||||
|
||||
or as a plain dependency: `uv add "tea @ git+ssh://git@10.0.10.41:2222/alberto/tea.git"`.
|
||||
Extras: `tea[s3]` reads `s3://` paths (endpoint and keys from the environment),
|
||||
`tea[export]` for the KTLX → EDF exporter.
|
||||
|
||||
## Batches
|
||||
|
||||
`Pipeline.map(..., cluster=)` runs the modern pipeline as a Dask graph:
|
||||
`"local"` (a LocalCluster on this machine), `"sync"` (one study at a time, in
|
||||
this process), `"remote"` with `scheduler="tcp://host:8786"` (any Dask
|
||||
scheduler you provide), or `"auto"` (`scheduler=` / `DASK_SCHEDULER_ADDRESS`
|
||||
if set, otherwise local). Legacy always runs a plain single-threaded loop.
|
||||
A study that fails becomes a row with `error` set; it never stops the batch.
|
||||
Rows carry the caller's `key`, never file names, paths or dates.
|
||||
|
||||
Reference in New Issue
Block a user