From c649ad9308848173e00e26846f2052a53dcc6d13 Mon Sep 17 00:00:00 2001 From: alberto Date: Tue, 1 Dec 2026 06:07:45 -0600 Subject: [PATCH] T17: models sweep: unused helpers in execution, association and the EEG analysis and checks removed --- models/execution.py | 6 ------ models/tea/association.py | 3 --- models/tea/eeg/analysis.py | 6 +----- models/tea/eeg/checks.py | 4 ---- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/models/execution.py b/models/execution.py index 874c11c..1d76dbb 100644 --- a/models/execution.py +++ b/models/execution.py @@ -15,13 +15,10 @@ from persistance.cluster import ( ClusterVersionError, Execution, ExecutionError, - Health, - Options, Progress, Resolved, Tasks, Worker, - health, options, resolve, ) @@ -30,11 +27,8 @@ __all__ = [ "ClusterVersionError", "Execution", "ExecutionError", - "Health", - "Options", "Progress", "Resolved", - "health", "map", "options", "resolve", diff --git a/models/tea/association.py b/models/tea/association.py index 9c34a13..4c4394b 100644 --- a/models/tea/association.py +++ b/models/tea/association.py @@ -587,9 +587,6 @@ class Ados2Association: return cls(d["level"], d["fitted"]) -MODULE = Ados2Association() - - class Model(mlflow.pyfunc.PythonModel): def __init__(self, fitted: dict): self.fitted = json.loads(json.dumps(fitted, default=float)) diff --git a/models/tea/eeg/analysis.py b/models/tea/eeg/analysis.py index 9fe6e18..de4b5f7 100644 --- a/models/tea/eeg/analysis.py +++ b/models/tea/eeg/analysis.py @@ -12,12 +12,12 @@ recording start minus `birth_date`. `analyze` never raises: a failure is an `Ana are None. """ -import math import re from dataclasses import dataclass, field from datetime import date from models.tea.eeg import biomarkers, checks, preprocess, read, sleep +from models.tea.eeg.curves import _number DAYS_PER_MONTH = 30.4375 MAINS_HZ = 60.0 @@ -49,10 +49,6 @@ class Analysis: error: str | None -def _number(v) -> float | None: - return float(v) if v is not None and math.isfinite(v) else None - - def _error(exc: Exception) -> str: message = re.sub(r"(/|[A-Za-z]:\\)[^\s'\"]*", "", str(exc))[:300] return f"{type(exc).__name__}: {message}" diff --git a/models/tea/eeg/checks.py b/models/tea/eeg/checks.py index 4236cb5..896c0e3 100644 --- a/models/tea/eeg/checks.py +++ b/models/tea/eeg/checks.py @@ -48,10 +48,6 @@ class Validation: line_db: float checks: list[dict] = field(default_factory=list) - @property - def ears_usable(self) -> bool: - return all(ear not in self.bad for ear in ("A1", "A2")) - def check( code,