A TEA training run can name its reference cohort (a folder under TEA_REFERENCE_ROOT with edades.csv) and mains frequency (50/60 Hz, validation only); the cache key and the reports carry both. GET /models/{domain}/{name}/training-config gives the train form JSON schema and defaults. Checks: ruff, import-linter, openapi diff, 8 model tests (sandbox).
tea_follow_up: one row per screening child (step, status, step date, M-CHAT score, latest ADOS-2 items for core.tea.ados2.score, first good EEG with duration, channels, whether a champion scored it and its result, alteration flags). tea_eeg_checks: every check of an EEG. tea_eeg_regions: electrode and zone values (new bronze.eeg_sites, written by save_analyses) with their age-curve scores. ADOS2_ITEMS: the 22 catalog items.
Checks: ruff, import-linter, dbt parse; compose: 9 passed (test_core_tea, test_persistance_eeg_sites, test_dbt_tea_follow_up on sqlite and postgres, test_synthetic_tea).
The edf node turns a column of EDF file hashes into edf_* header columns (patient code, sex, birth date, study date, record code, duration, channels, error) for identity and the eeg target. read.header parses the fixed header with the standard library (declared duration, zero signals accepted); _kept/_open keep edfio and refuse truncated or zero-signal files with FileNotValid.
Checks: ruff, import-linter, openapi diff; compose: 21 passed (test_core_pipeline, test_edf_header, test_edf_node, test_edf_upload); ng build clean.
Export (GET /models/{domain}/export) writes a deterministic zip of chosen versions with a manifest of SHA-256s, after the domain guard (TEA: n_reference >= 5, no study codes, dates or paths). Import (POST /models/{domain}/import, Dagster job import_bundle) stages the upload, checks its SHA-256 and that the operator listed it in $DATA_DIR/bundles/trusted (403 otherwise), verifies every file against the manifest and registers new candidate versions with lineage tags; duplicates are skipped.
Checks: ruff, import-linter, openapi diff; compose: 43 passed (test_bundles, test_runs, test_bundle, test_core_bundle_guard); ng build clean.
The hospital manifest records the sitio-b TEA hospital (sha256 2b2abae4...), which replaces the
200-child synthetic one. follow_up and patients are stored gzipped (58 MB and 6 MB as JSON); the
capture tool writes them that way with mtime 0, so a recapture is byte-identical.
tea_alterations: one row per child whose chain reached the EEG step, dated by her first good EEG,
altered when a metric scored by a champion curve falls outside p5-p95. tea_prevalence: every person
with a birth date, the day she enters and leaves the 16-36 month band, and her confirmation day.
add_days macro on every engine; tea.yml tests every TEA gold model.
As the CaMa pipeline does: the patients' sex (through the hospital_tea ConceptMap) and full name,
and the link compares sex too. M31 is stratified by sex; the follow-up list searches names.
The TEA gate runs once the sitio-b reference is captured (P0.3).
Default seed EEG verdicts by spec child index:
- 8: valid, complete.
- 9: valid, complete.
- 10: valid, complete.
- 11: invalid, not_analyzable. T3/T4 are dead and P3/P4/O1/O2
have abnormal amplitudes and intermittent bursts.
After validation, children 8–10 each return a ValueError during
preprocessing. The model's 100 Hz bandpass cutoff exceeds the 64 Hz
Nyquist frequency of the specified 128 Hz studies (since raised to 256 Hz). The test uses the
validation verdict as specified.
Implementation choices:
- Group the fixed profiles, table definitions and report item labels in
the generator. Insert child by child in a SQLite transaction. Use
truth row counts to allocate table-local IDs and flatten truth by table.
- Reuse the synthetic package's fixed PDF creation date and fpdf2's
default margins. Draw the score for the S/D item in print order, then
replace it with None before totaling and rendering.
- Evaluate continuous EDF events on the sample grid with start-inclusive,
end-exclusive bounds. Give awake the extra sample when the count is
odd. Draw the gap after every slow-wave candidate, clip blinks at the
awake boundary and evaluate beat Gaussians across the full recording.
Apply awake rhythm and slow-wave scaling to the positioned channels,
including ears, and give the auxiliary channels their specified events.
- Require positive whole-second durations and positive integer sample
rates. Keep zero-variance noise at zero. Apply channel faults after
adding mains. Write each study in a private temporary directory.
- Compare SQLite rows in primary-key order, and use case-insensitive
fixture patterns to check PDF text. The slow test prints the validator
checks and any analysis error when run with capture disabled.
- Updated the synthetic package entries in uv.lock against the existing
locked versions after the registry lookup failed. uv lock validated
the resulting lockfile.
The default sampling rate was raised to 256 Hz: at 128 Hz the analysis's 100 Hz band edge is above
Nyquist. At 256 Hz children 8-10 analyse fully (valid, complete, five metrics) and child 11 is not analysable.
M30_RESULTADO_EEG counts each child of the cohort whose first good EEG falls in the period, and
of them those with an alteration, one overlapping group per EEG metric. M31_PREVALENCIA counts
every person while in the prevalence age band by her state at the period's end, by sex.
core.measures gains Proportion.overlaps and StatusComposition.strata, generic for every domain.
core.tea sets PREVALENCE_AGE and EEG_METRICS; dbt reads both.