TEA EEG: training and analysis choose the cluster, EEG ids are text, run progress snapshots; tea library pointer

This commit is contained in:
ulises
2026-11-23 09:29:26 -06:00
parent f9d97f4d12
commit 2a04ee8c8e
9 changed files with 564 additions and 56 deletions
+17
View File
@@ -184,3 +184,20 @@ def test_a_reference_study_is_measured_from_its_path(tmp_path):
assert (st.valid, st.error) == (1, None)
assert set(st.features) == set(settings().scenarios.values())
assert set(st.features["spindles", "N2"]) == set(pipeline(settings()).module("spindles").features)
def test_training_reads_the_cluster_choice_from_the_environment(monkeypatch):
"""Pins down: training measures its studies on the runner `EEG_ANALYSIS_CLUSTER` names, and falls back to `auto`
for an unset or unknown value (including `off`, which only the analysis understands).
Fails if `run_steps` stops passing the choice to `train_all`, or lets an unknown value reach the runner.
"""
from models.tea.eeg import model
monkeypatch.delenv("EEG_ANALYSIS_CLUSTER", raising=False)
assert model._cluster() == "auto"
for chosen in ("auto", "local", "remote", "sync"):
monkeypatch.setenv("EEG_ANALYSIS_CLUSTER", chosen)
assert model._cluster() == chosen
monkeypatch.setenv("EEG_ANALYSIS_CLUSTER", "off")
assert model._cluster() == "auto"